progNewbie
progNewbie

Reputation: 4832

Android and background processes

I wrote an bluetooth app with my bt-connection established in a service, so the connection is still alive when I minimize my app.

But when watching my task manager, my app is still there. And when calling onDestroy in my app, I have to stop my Service.

But other apps like telegram or skype (whatsapp too I think) aren't in my task-manager visible but by having an incoming message they notify me nevertheless.

How is this even possible? How can I write my bluetooth connection like this, that I can really close my app and anyway the incoming messages will be handled?

Upvotes: 0

Views: 94

Answers (2)

eldjon
eldjon

Reputation: 2840

When you put remove your application from the foreground, Android keeps the activity on the stack again in case you will go back to it (unless you explicitly destroy the activity). So this maybe one reason why you still see it in the Task Manager. You cannot kill entirely the app and it will still post messages. Your service will be running in the background and it will be visible in the app Manager->Running Services.

However if you destroy your activities the app it will not be visible in the app list of the Task Manager.

Upvotes: 0

rupesh jain
rupesh jain

Reputation: 3430

The other apps might be having some light weight service running in other process which gets the data for the main app.Go to settings->application manager->running processes..you will see all the service..

Other mechanism which apps use is port-directed sms. In such a scenario you don't need any service running.However port directed sms doesnt work on all the phone and for all the apps.

Upvotes: 1

Related Questions