Shay Well-Known Member Licensed User Longtime User Sep 2, 2011 #1 Hi is there a way to recognize task event, such as turning on GPS without using timer, to check every x seconds that someone turned on or off the GPS I noticed that such action, does not trigger the activity resume or pause
Hi is there a way to recognize task event, such as turning on GPS without using timer, to check every x seconds that someone turned on or off the GPS I noticed that such action, does not trigger the activity resume or pause
thedesolatesoul Expert Licensed User Longtime User Sep 2, 2011 #2 I think this tutorial will tell you: http://www.b4x.com/forum/basic4android-getting-started-tutorials/6592-gps-tutorial.html Use: B4X: Sub GPS_UserEnabled (Enabled As Boolean) ToastMessageShow("GPS device enabled = " & Enabled, True) End Sub Upvote 0
I think this tutorial will tell you: http://www.b4x.com/forum/basic4android-getting-started-tutorials/6592-gps-tutorial.html Use: B4X: Sub GPS_UserEnabled (Enabled As Boolean) ToastMessageShow("GPS device enabled = " & Enabled, True) End Sub
Shay Well-Known Member Licensed User Longtime User Sep 3, 2011 #3 no this does not recognize if I click on GPS from the task area Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Sep 3, 2011 #4 You can check in Activity_Resume whether the GPS is enabled or not. If it is not enable use StartActivity to show the GPS settings page. When the user returns to your application Activity_Resume will be called again. Upvote 0
You can check in Activity_Resume whether the GPS is enabled or not. If it is not enable use StartActivity to show the GPS settings page. When the user returns to your application Activity_Resume will be called again.
Shay Well-Known Member Licensed User Longtime User Sep 3, 2011 #5 none of the events are been fired, since you never exit the app (sliding the task down and enabling GPS) Upvote 0
none of the events are been fired, since you never exit the app (sliding the task down and enabling GPS)
Erel B4X founder Staff member Licensed User Longtime User Sep 4, 2011 #6 Not all devices allow you to change the GPS settings from the notifications bar. You can explicitly call: B4X: If GPS1.GPSEnabled = False Then StartActivity(GPS1.LocationSettingsIntent) This will work for all devices and will allow you to handle the events. Upvote 0
Not all devices allow you to change the GPS settings from the notifications bar. You can explicitly call: B4X: If GPS1.GPSEnabled = False Then StartActivity(GPS1.LocationSettingsIntent) This will work for all devices and will allow you to handle the events.