Android Question Really keeping an app alive?

Discussion in 'Android Questions' started by Michael Gasperi, May 14, 2015.

  1. Michael Gasperi

    Michael Gasperi Member Licensed User

    I’ve been turning old smartphones into clocks, weather, and network status displays that are always plugged in and on. They need to run 24/7 without interruption. Currently I put a KeepAlive(True) in Activity_Resume, but once and a while I still find that something has apparently killed the app and it is just sitting on the home screen. What would be the best way to have an app run forever like this without any chance of being killed?
     
  2. thedesolatesoul

    thedesolatesoul Expert Licensed User

    Make it the launcher!
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    You need to use a foreground service.
     
  4. Michael Gasperi

    Michael Gasperi Member Licensed User

    Would I put the bulk of what I used to do in a service, and in the service_create call Service.StartForeground?
     
  5. Erel

    Erel Administrator Staff Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice