1. Check out our companion app, Forums for Android! Download from Google Play

Lifecycle on long running processes

Discussion in 'Application Development' started by brtancs, Aug 17, 2010.

  1. brtancs

    brtancs New Member
    Thread Starter
    5

    Aug 5, 2010
    4
    0
    5
    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
    53

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

    brtancs New Member
    Thread Starter
    5

    Aug 5, 2010
    4
    0
    5
    looks good, thanks
     

Share This Page

Loading...