Answer the question
In order to leave comments, you need to log in
How to get information about the location (location)?
I thought of making an application for mobile devices, where the determination of your location will be actively used. What is the problem? I don't know how to implement it.
I'm not interested specifically in the coordinates (there are a lot of such tutorials), but in the address of the location, which could be compared. For example, I visited the cafe "Cafeshka" and it was noted that you visited it. That is, I compared my location with the address of this cafe.
I need to get the street address, or, if I'm indoors, then the street address and house number (for example)
I hope that the essence is more or less clear. Is it possible to implement this and how?
Answer the question
In order to leave comments, you need to log in
Geocoder geocoder;
List<Address> addresses;
geocoder = new Geocoder(this, Locale.getDefault());
addresses = geocoder.getFromLocation(latitude, longitude, 1);
String address = addresses.get(0).getAddressLine(0); max available address lines by getMaxAddressLineIndex()
String city = addresses.get(0).getLocality();
String state = addresses.get(0).getAdminArea();
String country = addresses.get(0).getCountryName();
String postalCode = addresses.get(0).getPostalCode();
String knownName = addresses.get(0).getFeatureName();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question