In Android, I’m trying trying to have the user enter a place they name, say Walmart, then my program will give them the closest X number that matches that name. I know Geocoder can do this with major or specific locations, but I simply type in Walmart into it, it returns null which means it cannot find it.
Is there a way in Android, either using the Maps API or something else to have it perform and return the results for anything the user types in?
Yep you’ll need to use the Maps Places API from Google or the like to accomplish this.
You’ll need the user’s GPS coordinates or use network location. This can be tricky as they are allowed to deny access to those services in the settings. So be aware of that.
GeoCoder isn’t that great for that. It’s better at resolving addresses from a location. It’s not meant as a search tool for finding the closest Walmart. Notice that getLocationName does not accept coordinates. “Walmart” to it would be very ambiguous the best it could do is return all walmart locations which probably won’t happen.