Communicating with a Service

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Communicating with a Service

Postby ivolodarsky » Mon Feb 23, 2009 2:16 am

Hey guys,

I have a quick question about communicating with a service. I wrote a service which takes network requests from activities, puts them into a queue, and returns an integer ticket. Another thread on the service processes the queue (HTTP GET and POST) and then puts the responses into a dictionary with the ticket as the key.

So, after I start this service in a certain activity, I want to keep a reference to the service object in other activities. I also would like the service to stop when all the activity instances are stopped by Android.

However, as far as I understand, I need to write an interface and an .AIPL file to communicate with the service after i move to an activity which did not start the service. Is therer any way I can get around that and just get the service instance without going through converting all non-standard types to Parceable and so forth?

Thank you.
Posts: 2
Joined: Mon Feb 23, 2009 2:10 am


Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 2 guests