To ON OFF GPS using App Inventor

129 views
Skip to first unread message

Vimal Kumar

unread,
Jul 22, 2019, 5:49:36 AM7/22/19
to MIT App Inventor Forum
Hi,

Can you please let me know whether its possible to ON and OFF GPS using App Inventor (On New Android Versions).

Sincerely,
Vimal Kumar.V

SteveJG

unread,
Jul 22, 2019, 8:29:40 AM7/22/19
to MIT App Inventor Forum
Developers can not turn the GPS on or off using code Blocks on Android version above about 4.1.  Even developers using Android Studio can not turn the GPS hardware on/off.  The GPS hardware must be turned on and off manually.   Use the device's Location Settings (or the device's notification/settings bar)

You can use an ActivityStarter to provide the users with the location settings screen https://groups.google.com/forum/#!msg/mitappinventortest/aFpGSCdAN5A/Eo5FtBhODAAJ  .  The User can use that screen to manually change the GPS settings.    App Inventor 2 developers can turn on/off the LocationSensor using the set LocationSensor.Enabled to true or false but that merely disables your app from reporting what the GPS receiver reports if it is on.

Is that what you wanted to know?

Regards,
Steve

ABG

unread,
Jul 22, 2019, 10:50:32 AM7/22/19
to MIT App Inventor Forum
Reply all
Reply to author
Forward
0 new messages