Help implementing ShinyJobs on Android #1559
-
I am trying to implement Shiny Jobs for a gps update in my app. So far it works ok with the phone connected to the charger, but it stops whenever is disconnected for an hour or so.... To explain, is the job works good by itself. If I disconnect the phone from the charger it works amazing for the first hour, I mean with the phone blocked with the screen off, after that it just suddenly stops. That is not happening on iOS so I think is not a bug, just that I am missing something in my implementation as I have nothing different for android, anyone has suffered this issue and know how to solve it? My implementation is MauiProgram.cs
MySaveTrackingJob
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Jobs are periodic. Not scheduled and depending on what the OS thinks, could take a day before it runs again depending on many conditions. |
Beta Was this translation helpful? Give feedback.
-
No yeah I understand that it is periodic, it actually works amazing as the app is up or in foreground or background. |
Beta Was this translation helpful? Give feedback.
-
it inmediatly starts working back if the app is opened back again |
Beta Was this translation helpful? Give feedback.
If your phone is charging, Android will run in happily as much as possible. If it's not charging it can take a day or more. You should read on doze mode and how Android jobs work to get a better understanding