Search code examples
javaandroidandroid-servicedaemon

create a deamon process in android


For the project in android that I am having I need to make a server as daemon process to handle request in the background even if the app is closed.

Is there any way to create a daemon process. If so will it killed by app on exit. or How to kill the daemon process/threads in android.

Can i have an example syntax regarding the creation of Daemon process.

If A is my app main process and B is my daemon server process. If A is killed and B got a request that invokes some functionality of A, then the A main will start or what will happen


Solution

  • if I get it right; you are looking for android services and here is something that can help you with that:

    http://www.tutorialspoint.com/android/android_services.htm

    and yes there are many ways to shutdown a service check out the tutorials for more information.