0

I want to show food stores as per user street for example if user is in street name called ABC then map will show only those marker which is around in street ABC

 if (userlocation == "isInStreet1") {
        thencallThisfunction();
    }

else if (userlocation == "isInStreet2") {
Toast.makeText(getActivity(), "There is no food store around you", }

but i don't have any idea how to do this ... i can able to get current location of the user but i am not getting how to show nearby object as per their location

  • from where do you tend to get the information on ```"There is no food store around you"``` – rakesh kashyap Aug 29 '16 at 15:31
  • i have already placed google marker in my app all over the city .. if some places are there is no marker nearby then it will show there is no food store around you – Utkarsh Sharma Aug 29 '16 at 17:17

2 Answers2

0

Have you considered using the GPS to get your coordinates and then using them to get the address info including the street name. Once you have that infomration you can compare the strings to the list of street names you have. See the accepted solution from this question: Android - How to get street name from coordinates?

Community
  • 1
  • 1
Shai Herman
  • 126
  • 9
  • that can also helpful but how to get the only street name if I can get only street name only my problem will solve .. i have a code but it get me the whole address like this way -- 1600 Amphitheatre Pkwy Mountain View, CA 903 Mountain View 94043 United States – Utkarsh Sharma Aug 29 '16 at 17:26
  • String userArea = addresses.get(0).getAdminArea(); ?? will this function getAdminArea() can help me to get user Area name ? – Utkarsh Sharma Aug 29 '16 at 17:43
  • you can extract address only by using addresses.get(0).getAddressLine(0); have a look at the accepted answer here: http://stackoverflow.com/questions/9409195/how-to-get-complete-address-from-latitude-and-longitude – Shai Herman Sep 01 '16 at 10:21
0

It seems like you'd want to use the Google Places API.

In particular the Places 'search' function which allows you to find places near a specified Latitude/Longitude

edant92
  • 694
  • 8
  • 18