Location accuracy sometimes poor (half a mile out) on new phone

It looks like you did not follow the suggestion from @SteveJG here

You still set the provider name to gps in the Screen.Initialize event, which is wrong, because you only can set it if it is available as already mentioned earlier...

What about providing an updated screenshot of your relevant blocks?

Google 'improves' Android from version to version mostly because of security reasons

You will have to test using the apk file

This is the concept of Google... apps can't just set permissions they need, apps have to ask the user for permissions...

Taifun

Also you might want to check both the provider name and accuracy on each location changed event

http://ai2.appinventor.mit.edu/reference/components/sensors.html#LocationSensor

Accuracy

The LocationSensor will be able to locate the device with a varying degree of confidence, based on the quality of satellite, cell towers, and other data used to estimate location. The Accuracy value is the radius in meters around the sensor’s detected location. The device has a 68% chance to be located within this radius. More precise location detection will result in a smaller accuracy number, which allows the app to have more confidence where the device is actually located.

If the accuracy is not known, the return value is 0.0

ProviderName

The current service provider. The provider will most likely be either GPS or network.

You probably think you are using gps, but actually are using another provider, for example fused location... also depending on the location the signal might be poor... probably in a forest or between tall buildings... here it helps to check the accuracy...

Taifun

Aa a test you also can try my locationservice example project, documentation is here App Inventor Extensions: Location Service | Pura Vida Apps

Example project downloadable from Google Play here
https://play.google.com/apps/testing/appinventor.ai_taifunbaer.locationservice

Taifun

Thanks (Taifun) for these comments. I like your use of the word "improves", but it is frustrating that what works on an earlier version doesn't on the latest version! An error of half a mile (only occasionally) is not trivial.

I was wrong about not being asked for permission for Fine Location. I was expecting it to ask every time I ran the app, but it only asks the first time and I assumed it was part of the installation process. (I'm doing all the testing with an apk file on the phone.)

I've tried lots of thing and I think the winner at the moment is my original app with these extra blocks (although there are too many variables to be sure):

However, there is still an error of up to about 20m which is not as good as Android 8.1.

Therefore

to find out why
Taifun

That sounds like an excellent idea which I will try if/when I have the patience.

However, yesterday's trial was sitting on a bench by a pond in a town. Today I tried sitting on a broken tree trunk in a wood and the results were very different. Yesterday's winner had me 500m north of where I actually was, followed shortly by 2000m east (more than a mile)!. And it didn't budge. The new winner which was close (within about 50m) was the original app with just two extra blocks:
image

If only Google would stop their "improvements". No problems with Android 8.1.

1 Like

I do not want to repeat myself... just start reading again from here Location accuracy sometimes poor (half a mile out) on new phone - #21 by Taifun

You still set the provider name to gps in the Screen.Initialize event, which is wrong, because you only can set it if it is available as already mentioned earlier...

Taifun
PS: this thread is trapped in an endless loop

But it works better than the other options which sometimes produce massive errors. If gps is not available (in a big building perhaps) then I wouldn't expect the app to work. But it all seems very dependent on where I am which makes it very difficult to work out what's going on.

1 Like