App moves to background or loses connection after extended idle: configure Single App Kiosk Mode
Android
When you configure an app to auto-start on device boot using a Blueprint, the app may move to the background or lose its network connection after extended idle periods. This happens because Android's standard task management and Doze mode can suspend background activity. You can prevent this by enabling Single App Kiosk Mode and configuring battery optimization exemptions.
Before you begin
Check that your device is provisioned as Device Owner (DO). Kiosk Mode features require Device Owner provisioning; Profile Owner (PO) mode does not support full Kiosk lockdown.
Step 1: Enable Single App Kiosk Mode
- In the Esper Console, go to Blueprints and select or create the Blueprint applied to your device(s).
- Find the Kiosk Mode section and enable Single App Kiosk Mode.
- Set your merchant application as the Kiosk app.
- Save and publish the Blueprint.
- Apply the Blueprint to your target device(s) by navigating to Devices & Groups → [Device Name] → Blueprint → Apply.
Once Single App Kiosk Mode is active, your device locks to the designated app. The Android home screen and task switcher become inaccessible. Esper automatically detects if the kiosk app crashes, stops, or moves to the background and relaunches it to the foreground—no additional watchdog configuration needed.
Step 2: Exempt your app from battery optimization
To prevent your app's network connection from dropping during idle periods, configure the device to bypass Android's Doze mode and battery optimization for your app.
- In your Blueprint, go to Device Settings → Battery Optimization (this section may appear under Advanced Settings or Compliance Policy depending on your Esper Console version).
- Add your merchant application's package name to the battery optimization whitelist or exempt list.
Alternatively, ask your app development team to configure a foreground service with a persistent notification. This signals Android to treat the app process as active and exempt it from Doze suspension.
Step 3: Verify your configuration
- After applying the Blueprint, confirm on your physical device that the merchant app launches automatically on boot and fills the screen.
- Press the Home and Back buttons. These should not exit the app or reveal the Android home screen.
- Test app recovery by running:
adb shell am force-stop <package_name>. Esper should relaunch the app to the foreground within a few seconds without manual intervention. - Leave the device idle overnight, then verify that the app's connection remains active by performing a transaction or pinging your backend.
Troubleshooting
App still moves to the background in Kiosk Mode:
Confirm the Blueprint has been fully applied to the device. Go to Devices & Groups → [Device Name] → Blueprint Status. The status should show Applied, not Pending or Error. If the status is stuck, check your device's network connectivity and reapply the Blueprint.
Connection still drops after exempting the app from battery optimization:
The issue may be server-side—your backend may be dropping idle connections due to TCP keepalive timeouts, or your app may need built-in reconnect logic. Contact your app development team or merchant platform vendor to investigate.
Kiosk Mode is unavailable in your Blueprint:
Verify that your device is provisioned as Device Owner (DO). If your device is provisioned as Profile Owner (PO), Kiosk Mode features are not available. You will need to re-provision the device as Device Owner.
Still need help?
If the steps above do not resolve your issue, or if Esper's management agent fails to relaunch your kiosk app after a crash, contact Esper Support.
Please sign in to leave a comment.
Comments
0 comments