Seems their were some updates to methods in this area as many existing examples do not work right…
Can someone show me how to get the name of the city from the network w/o gps and toast to screen?
It would be MUCH appreciated.
Thank you in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Get the latitude and longitude using
NETWORK_PROVIDER, which won’t use GPS.Here is a
Locatorutility class I wrote for my purposes, you are welcome to use and it modify it. It is working and tested in an app withminSdkof 7.Make sure you add the appropriate permissions in your
AndroidManifest.xmlto use location providers.Then use an API from say Google Maps or something to convert to city name.