Search code examples
androidgeolocationgpslocationcoordinates

How to get gps location with Network MOBILE and not Network Wi-Fi


Is it possible to get the coordinates only with the mobile network enabled? I need to get the coordinates within 30 seconds. Because when the user clicks the button to hide, it can not be too long to get the coordinates. I can not use NETWORK_PROVIDER to get the coordinates of the Wi-Fi network because the user will be on the street and not connected to a Wi-Fi network, but will have the mobile data network connected. Is it possible to get coordinates over the mobile data network? I know GPS_PROVIDER is slower than NETWORK_PROVIDER, so I'd like to know if it's possible as I said above. Thank you!


Solution

  • Is it possible to get the coordinates only with the mobile network enabled?

    Yes. For example, navigation apps work while driving in open spaces, far from any WiFi.

    I need to get the coordinates within 30 seconds

    There is no way to guarantee this. There is no way to guarantee that you can get a GPS fix in any amount of time. There are plenty of places in the world where it is difficult to get GPS signals.