i have to make an android application in which i need to find the current location of the user. For this i am first using the GPS provider, but if it is not available i fall back to the network provider. Now there have been instances on my phone when even the network provider is not working and the statement network_enabled = lm .isProviderEnabled(LocationManager.NETWORK_PROVIDER);
is giving a false value.
My question
i am still able to make calls from my phone, so my network provider is working fine. what i need to know is in what conditions does the network provider not work? what could be the possible scenarios where the network provider on my android device not work to supply me my co-ordinates.
thank you in advance
Manually select your network providers It's possible that your device is having trouble finding your network, and you have to select it yourself. Go to Settings> Connections > Mobile networks > Network operators. A list of network providers should show up. Select yours and see if this fixes your problem.
Open your Settings app and tap Network & internet or Connections. Depending on your device, these options may be different. Turn Wi-Fi off and mobile data on, and check if there's a difference. If not, turn mobile data off and Wi-Fi on and check again.
Open your device's Settings app. Tap About phone. To find manufacturer info, tap Model & hardware. To find carrier info, tap SIM status and check under "Network."
Two days puzzled over this problem. I found a solution. Just go to Settings -> Location & security and enable flag "Use wireless networks" in "My Location" group.
But now I have the question: what is default state of this flag? It will be very sad if the application would have to ask the user to enable this flag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With