Issue about LocationSensor Component in Android 11

To whom it may concern,

I have a Google Pixel 2 phone who is currently running Android 11. When I run an app that uses the LocationSensor component on it, it fails to show the location, if I choose "network" as the location provider. After some troubleshooting, I've found out that by viewing the component's "AvailableProviders" property, the value is: ["gps", "passive", "gps"], so that without "network". While when I run this on an Android 10 device, the value is: ["gps", "passive", "gps", "network"], which contains the word "network" as normal.

I don't have a Pixel so I cannot confirm your device behavior.

I suspect your Android Location Settings do not have the Use wireless networks option checked

image . Please check your device Settings..

Thank you for the prompt reply and suggestion, Steve.

I've checked the setting, the setting in this Android 11 phone is called "Wi-Fi Scanning" and it is on. So, your suggestion doesn't relate to my issue.

But anyway, the problem is solved now, albeit in a strange way. I opened the Google's "Maps" app, and tried to see if it works alright indoor (as indoor environment forces it to use "network" option). When I pressed the "acquire location" icon, it asked me to allow something called "Google Location Service". I allowed it and it then successfully gave me the location. After that, I went back to my app, and since then everything works fine (when I view the component's "AvailableProviders" property, it gives me back the "network" value).

One more thing to say, I've just found out there is a setting called "Google Location Accuracy". When switching off, only GPS will be used. So, I think this is probably the real reason I could not it at first.

By the way, I think the name of this setting is a bit misleading :thinking: :disappointed_relieved: It's not easy to think by turning on this option, the "network" option is turned on.

Glad you got a solution. How this works is beyond App Inventor. Google continually changes how this works as they add new Android versions and they continually add new 'features'. How they name them is up to them. :slight_smile:

Thank you for posting your solution. It may help others with Android 11 devices.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.