Better approach to get the Current Location?

Not applicable

we are building a App my question is it better to call the google current Location API in Apps or we will move the same in APi mangment Layer to call in service call out?The app will tell how many near by ATM from My current Location

0 2 82
2 REPLIES 2

Not applicable

If I understand your question correctly, usually you'd get the current location from the device, then pass the lat/lon to your API and have it do a geolocation query to return any entities within a certain radius (or geofence or whatever) of the current location. The API layer wouldn't have the ability to accurately figure out the device's location compared to the device itself. You'd have to rely on an IP geo database unless you have some other mechanism available to approximately figure out the location. Let me know if I'm misinterpreting your question.

Not applicable

I prefer a layered approach to these use cases.

Your API can allow the device to specify a lat and lon on the API call as optional arguments. Consuming clients can then use the native location APIs on the device to locate the client and provide a definitive location.

When lat and lon are NOT specified then you can use a ServiceCallout to a location API to find an approximate location for the consumer based on the IP address.