Reputation: 2745
I'm using Google map v2 in my android app to get my location and it works well. Now I want to get my country meaning that if I'm in Cairo or Alexandria, the code tells me that I'm in Egypt. And if I'm in New York or Washington, the code tells me that I'm in USA.
How can I do this by code?
Thanks in advance.
Upvotes: 0
Views: 1499
Reputation: 22232
Use Google Reverse Geocoding API.
Sending a LatLng, you get a list of possible addresses. One of them is the country.
Example:
http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true
Upvotes: 2