How can I let my Android application code schedule an event to an API so that the event happens even if the Android phone is offline? I want the app to be free of charge and don't want to integrate cloud.
I didn't try anything.
How can I let my Android application code schedule an event to an API so that the event happens even if the Android phone is offline? I want the app to be free of charge and don't want to integrate cloud.
I didn't try anything.
You don't, unless the API itself has a schedule functionality. If the device is offline, you can't send an HTTP request. Now if you want to schedule it for later and either don't care when it happens (just have it happen the next time you do have internet access), you can use JobScheduler to schedule a job in the future that will make the API call. Or if you want to do it at a specific time, you can use JobScheduler for that as well and just hope the device is online then (with an optional try again later if it isn't).