Android Question [B4X Pages] How to restart an Application after a Crash

Mike1970

Well-Known Member
Licensed User
Longtime User
Hi everyone, I've to develop a Kiosk Mode Application (for a panel pc/tablet)... I'm concerned about what happens if the app crashes...
Is there any robust way to restart the application in case it crashes?

Thanks in advance
 

JohnC

Expert
Licensed User
Longtime User
If the app crashes and it displays a "xxxx app has stopped" prompt, then I don't know if there is a way to programmically restart the app. In this case you might need to use a hardware watchdog to power cycle the device if it doesn't receive the poll signal from your app on a regular basis (every x minutes). This method will only work with devices that don't have a battery in them such as inexpensive android boxes.

The other software-only method would be to use the StartServiceAt (or it's newer non-service version) method to set a time in the future and have your app keep readjusting this time every minute so that if your app keeps running normally, the scheduled time will never "trigger". But if your app crashes, then it will trigger and can respawn your app.
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The app defined as AdminKioskApp should be startet automatically or not?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
what do you mean with "AdminKioskApp"?
 
Upvote 0

Mike1970

Well-Known Member
Licensed User
Longtime User
Thank you to point this out.
I'm doing some research to understand the actual feasibility, so relative to your question, yes I need the app to start automatically at boot and relaunched in case it crashes, because this tablet will be used in a totem that must be always operative
 
Upvote 0
Top