0

When user once run my app then it has not be stopped even if device is turned off. When mobile turned on then this app has to be run automatically.

If possible then please share any method to do so. Thanks

Onur A.
  • 3,007
  • 3
  • 22
  • 37
ALI ZOHAIB
  • 23
  • 5
  • you can [start service on boot](https://stackoverflow.com/questions/2784441/trying-to-start-a-service-on-boot-on-android). I think it's not possible to start whole app. – Stefan Golubović Mar 08 '18 at 18:19
  • My app is auto=uploading images to the server when connected to the internet. But when mobile turned off and again turned on then I have to again start my app in order to upload the files. – ALI ZOHAIB Mar 08 '18 at 18:26
  • 1
    in that case you need to create a [service](https://developer.android.com/guide/components/services.html) that will be responsible for uploading images, and also you'll need to somehow track images which are not uploaded (use local DB or shared pref, for example). [When phone is booted, start your service](https://stackoverflow.com/questions/2784441/trying-to-start-a-service-on-boot-on-android) and upload those images. That's my idea for now. – Stefan Golubović Mar 08 '18 at 18:41

0 Answers0