views:

186

answers:

3

Do the Android users have the chance to reset the NetworkProvider, so that the location will be null? I came up with the idea, that its only possible to have that location null, after starting the device the very first time. But also than google will check the location right away for my opinion.

Sure, I'm implementing a default location for this rare case. I just want to know how seldom this case is.

A: 

In my testing I've found it's null fairly often. Not a lot of things consume the GPS without the user telling them to. But the problem with getLastKnownLocation is that it can be extremely out of date. So even if it's not null, it could be hours or even days old

Falmarri
Hey Falmarri. I was asking for Location data provided by NETWORK_PROVIDER, not GPS. Anything else than null is fine!
OneWorld
Oh. Hmm. I've never actually tried only using the location from the network provider without registering the listener. If I get the chance I'll run that on my phone tomorrow
Falmarri
+1  A: 

Depends how frequently connects the user to the Internet.

The cell ids have to be translated to a coordinate, and as I know there is a cache, it will remember even when offline the cell ids already translated, but on new ones, it won't give you location updates until the phone it's not connected to Internet.

Anyway, you always needs to check the date of the location, as it might be outdated. Especially after you put your phone in airplane mode and travel to the other part of the world.

Pentium10
A: 

It returns 'null', when the Service is disabled in Settings > Location and Security > location through network

So that can happen quite often.

OneWorld