Location sensor works while disabled

I noticed that when I delete and reinstall my app, the Location Sensor automatically requests location permission the first time the screen containing the Location Sensor component is opened after installation, even though I haven’t enabled it or used any blocks to request the location. This happens even if the “Enabled” property of the Location Sensor is set to false.
any help?

Android automatically triggers a permission request for ACCESS_FINE_LOCATION or ACCESS_COARSE_LOCATION.

This is due to how the underlying Java code is written in the App Inventor framework, the permission check is called when the component is created, not only when it’s used or enabled later.

Suggestions

Don’t place the LocationSensor directly on the first screen (or any screen that opens automatically).

Place it where you want to use location sensor only, it will request permission from that screen

1 Like