Lifecycle on long running processes


Last Updated:

  1. brtancs

    brtancs New Member This Topic's Starter

    Joined:
    Aug 5, 2010
    Messages:
    4
    Likes Received:
    0
    Hi,

    I'm wanting to push various binary data to applications I have running on Android 1.6 devices. I'm considering a combination of SMS messages and running either a service listening on a socket or a web server on the phone.

    I'm curious though; at what point the running web server or service (the minimal execution scenario is just waiting on a socket) would be stopped by the OS automatically, if ever.

    Also, if the server is stopped automatically - can the user be notified and/or given a choice on whether to proceed with stopping the app; or is there a way to except a process from automatic cleanup? From the docs, I'm guessing no here.

    thanks.
     

    Advertisement
  2. cp1

    cp1 Well-Known Member

    Joined:
    Apr 30, 2010
    Messages:
    375
    Likes Received:
    35
    I think you can use setForeground or startForeground, depending on the android version.
     
    brtancs likes this.
  3. brtancs

    brtancs New Member This Topic's Starter

    Joined:
    Aug 5, 2010
    Messages:
    4
    Likes Received:
    0
    looks good, thanks
     

Share This Page

Loading...