Android Question Enable Gps

kreativa

Member
Licensed User
Longtime User
Hi, just a question.
I'm working with gps.
When the gps is not enabled i use StartActivity(gps1.LocationSettingsIntent) and the app moves the users in the preference panel to enable gps.
Everything works properly but is it possible to enable gps without leaving the app?
thanks!
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

eps

Expert
Licensed User
Longtime User
I think you can - but be careful as you also need to switch it off when your App isn't running.

1) You need to request setting of the GPS in the manifest. See here : https://developer.android.com/training/location/change-location-settings.html

2) Check the min SDK level

3) See here - but I'm not sure how to implement it in B4A.... https://stackoverflow.com/questions...programmatically-on-android/33555732#33555732 and this http://www.digitstory.com/enable-gps-automatically-android/#.Wa7Cg601RAY

But it should be possible with a little jiggery pokery.

HTH

ETA : I guess you've seen and read this thread? https://www.b4x.com/android/forum/threads/gps-tutorial.6592/#content
 
Upvote 0
Top