Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

network provider not working in android

Tags:

android

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

like image 967
user590849 Avatar asked May 31 '11 05:05

user590849


People also ask

How do I fix my Android Network provider?

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.

What to do if mobile Network is not working?

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.

What is my mobile Network operator?

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."


1 Answers

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.

like image 54
GAP Avatar answered Oct 04 '22 17:10

GAP