M Mike1970 Well-Known Member Licensed User Longtime User Jun 8, 2019 #1 Hi everyone, i'm dealing with the GPS and FusedLocationProvider. My app is costantly tracking with the FusedLocationProvider, but the SO kills the process because it drains too much current. So my idea was to disable the gps and flp after it receives the location updates, and than re-enable it after 10 minutes, so i save energy, and the SO doesn't kill the process. The problem is that if i stop the gps, i can't handle the "GPS_UserEnabled (Enabled As Boolean)" event anymore.. and i NEED it to show a dialog when the user disable the gps while the app i opened (even if the gps is in the 10 minutes shutdown period) Any suggestions? Thanks
Hi everyone, i'm dealing with the GPS and FusedLocationProvider. My app is costantly tracking with the FusedLocationProvider, but the SO kills the process because it drains too much current. So my idea was to disable the gps and flp after it receives the location updates, and than re-enable it after 10 minutes, so i save energy, and the SO doesn't kill the process. The problem is that if i stop the gps, i can't handle the "GPS_UserEnabled (Enabled As Boolean)" event anymore.. and i NEED it to show a dialog when the user disable the gps while the app i opened (even if the gps is in the 10 minutes shutdown period) Any suggestions? Thanks
Erel B4X founder Staff member Licensed User Longtime User Jun 9, 2019 #2 You can use a timer that checks the value of GPS.GpsEnabled every minute or so. Upvote 0
M Mike1970 Well-Known Member Licensed User Longtime User Jun 9, 2019 #3 Erel said: You can use a timer that checks the value of GPS.GpsEnabled every minute or so. Click to expand... Yes, in the end it's what i've done I was hoping in something different, but it seems to work, so i think i will keep this solution Upvote 0
Erel said: You can use a timer that checks the value of GPS.GpsEnabled every minute or so. Click to expand... Yes, in the end it's what i've done I was hoping in something different, but it seems to work, so i think i will keep this solution