Is it possible re-open app? RRS feed

  • Question

  • User394398 posted

    Hello guys, I’m developing app now, so user press button and then user’s geolocation pass to the server every set time, so I did it in background through Matcha.BackgroundService library, but I have a problem - when user cross country border there is small offline time and my app stop working maybe cuz of no network connection or waiting for roaming, so how I can re-launch it in iOS and android, I think in android I should use to broadcast service but I don’t know. Maybe it’s not needed to relaunch only keep it in background when no network and when it reveal, continue to pass geolocation Sorry for my English:) Thanks all

    Sunday, July 5, 2020 6:01 AM

All replies

  • User371688 posted

    In Android, starting in Android 8.0 (API level 26), an Android application no longer have the ability to run freely in the background. For more details about this, you can refer to Background Execution Limits in Android 8.0:

    Yes, you can try to restarted the service once it been finished by a BroadcastReceiver just as you said above. The function of BroadcastReceiver is to receive a signal when someone or something kills the service; its role is to restart the service.

    For more details, you can check: https://fabcirablog.weebly.com/blog/creating-a-never-ending-background-service-in-android Though it's Java code, it's easy to understand and convert

    Monday, July 6, 2020 6:45 AM