G
G
Grisha Nikolsky2015-08-26 20:49:40
Android
Grisha Nikolsky, 2015-08-26 20:49:40

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

2 answer(s)
O
Oleg Gamega, 2015-08-26
@VoxelGod

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();

you can also use some kind of Google api with a regular http request, in one project this was done, but the code was not saved

R
Rustem Saitkulov, 2015-08-26
@atetc

Google Places API

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question