Do I need a service from an application for Android?

In my application I have a few actions and a Java class with the stream. This stream continuously receives and sends messages to the web server. The application works great when testing, but I'm worried that it cannot be used on real phones. I am afraid that my background thread, which is constantly interacting with the server, may be killed by Android, and the application is in the background.

I really need to make my client class-line service? I want to start it when the user comes and stops when the user logs out.

If I need to do this, ask a few simple instructions.

+4
source share
2 answers

As far as I think, you'd better use TimerTask along with Timer along with any regular class or service, your goal will be enough.

+3
source

All Articles