How to get the city and country of the user in an android without GPS?

How to get users from city and country from an Android application without GPS?

+4
source share
6 answers

You can do this through the cell tower or WiFi location. Or through the PassiveLocation provider. You can find out about this in this Google I / O video (min. 20) http://developer.android.com/videos/index.html#v=twmuBbC_oB8

+3
source

From thread on the mailing list:

  • You can use the phone number assigned to you. Phone number starts with country code.
  • In addition, IMEI has information about which country your phone has been approved / registered for.

"If you try to get the information you are connected to MNC-MCC, use the TelephonyManager.getNetworkOperator () API. MCC (mobile country code) is the information you are looking for.

Apparently the easiest of all getLocale (). getDisplayCountry () doesn't work at all, so without a location API this is all you can do (besides a Wi-Fi location).

+2
source

Get users location through LocationManager.NETWORK_PROVIDER . Then use Geocoder to get the address from the location.

0
source

another solution would be to use a web service that detects the user's location through an IP address.

http://ipinfodb.com/ip_location_api_json.php

0
source

You can also use the IP address, there are some web services that will give you the location of the caller: http://free-web-services.com/web-services/geo/ip-to-location/

0
source

Open the dialog box and ask for a zip code?

Where else exactly would this β€œdata” be if not for GPS?

-2
source

All Articles