I want to collect the Latitude and Longitude
from user device.
There are multiple ways to do so. Right now am collecting the lat/lang from Google's API
<--- SO Answer.
Now there are also multiple methods in which they check the provider i.e either GPS OR Network Provider and collect the location using LocationListener
and collect the data.
A sample code will be this <--- Again a SO answer.
Both of them are working but my question is , what if the user has given the Location Permission and then turned of the Location
service from settings. In that case I'll like to collect the lat/lang solely from the network provider.
But when I try the above codes after turning off the Location
Every time the requestLocationUpdates
returns a null
location.
Basically I want a fall through options to collect the lat/long.
1-> Google Api (When location is on) 2-> LocationMangaer (When location is on) 3-> Get lat/lang from cellular tower (When location is off, wifi is off and GPS is off)