1

This is a continuation of a previous question.

I'm developing an app whose only purpose is to display the closest Joe's Florida Tacos locations to my current location in Florida. It will have the usual list (closest first) and a map with the markers. The app doesn't have any use outside of Florida.

Under normal circumstances, the user enabled "current location" so the app will display a list with the closest locations to user (like this). If the user switches to the map, the map will display location of the user and several markers.

But let's say that "current location" is disabled. What will be displayed in the initial screen, where the list should be? Will it be empty or will it display everything? And let's say that the user switches to map, what will the map display?

Is it possible to get an approximate location even if current location is off?

I don't want to require that the user enables current location, but I don't know what to display if it's disabled.

5 Answers 5

3

Maybe you could ask them for a zip code or city or something like that?

0
1

In this situation, the location data is in no way vital to your apps functionality. For that reason I would be developing the application assuming you do not have that permission and only use the permission to enhance the user's experience.

I've recently developed a very similar solution for an ongoing project I'm working on. I defaulted to showing an alphabetized list of locations (though you could also sort by popularity or other relevant metric) and then I allow the user to tap on a button to find the closest location to their current position. At that point I request the location permission as the user is more likely to accept when actually trying to do something which requires it and then perform the sort if granted or show a toast/snackbar message telling the user that location is required if they don't grant it.

Eventually I will also be adding a map view which will default to a zoom level which shows all locations and from there the user can either pan and zoom as they please or provide location permission to automatically zoom in on their local area.

1

The answer depends too much on things you didn't tell in the question, but to share a few thoughts:

Let users at anytime be able to enter a location manually so they can save it for later or share it with someone. Or is it only relevant at that specific time and only for that user?

What the begin state has to be without location data, is not something to ask here. It is something you should know from the user base. What will be the most relevant data for them to see when they don't (want to) share their location? If nothing is relevant it has no use to just throw something at them.

0

Your question is generally asking for imaginative input, I would consider it not an appropriate question for that reason.

"Is it possible to get an approximate location even if current location is off?"

Is a question best asked on Stackoverflow, as you are looking for mobile features to access within code.

Yes, it is possible to get an approximate location even if current location is off. You could:

  • make an educated guess based on the device's Locale, or TelephonyService on Android.
  • make an approximation using the response from a web system that provides a location service, e.g. http://ip-api.com/json
  • prompt the user to enter location information using a form.
1
  • IP-based geolocation is generally quite good for fixed connections, not so much for cellular/mobile. It can deliver a result hundreds of km away.
    – jcaron
    Jan 17, 2020 at 9:06
0

In this specific situation, you could:

  • on the map view: show the whole state, let the user zoom in, add an input to enter a place (city, zip, full address...) using the usual APIs

  • on the list view, you can either display nothing or display all locations sorted by city name or by zip code (the latter is probably more useful as it’s probably easier to find a “nearby” location that way, but it’s not necessarily obvious for the user that this is the sort order), but you should add an input like above. Not displaying anything is probably the best way to force the user to male an input

  • one alternative, but I doubt it would be practical here, is to have a drill-drown “explorer” selection of the location. E.g on a global scale it would ask for continent, then country, the state, then county, then city. But this often produces levels with very long lists, or, alternatively, ambiguous selections.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.