Search code examples
androidgeofencingandroid-geofence

Are Android geofences surviving a reboot?


is the system persisting them or do I have to add them again them after reboot? I have not found anything about that in the documentation at https://developer.android.com/training/location/geofencing.html


Solution

  • Geofences will not persist on reboot.

    You have to listen for BOOT_COMPLETED action and add geofences again.

    Note: If your app installed on external storage(SD card), you will never receive Boot Complete action. So you have to specify android:installLocation="internalOnly" in the manifest tag. This is because, android device will broadcast BOOT_COMPLETED action before setting up the external storage.