Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android service-to-activity communication performance

Tags:

android

I can find several examples of how to build a service, but I'm having a difficult time finding a working example of how to send messages between an Activity and a Service. From what I can find, I think my options are to use Intents, AIDL, or to use the service object itself as per this question.

In my case, my activity is the only activity that will ever access the service, so a local service will do. When the activity is open, I want to see some status messages from the service, which will be coming in at up to 20 Hz. Are there any limitations on how many messages per second those communications methods will support? Basically, which method is going to be best for my situation?

Thanks.

like image 945
Lance Lefebure Avatar asked Nov 28 '10 03:11

Lance Lefebure


1 Answers

Since your Actvity and Service are a part of the same app, then no need to use AIDL. You may simply use your Service as a local one.

like image 118
Vit Khudenko Avatar answered Oct 15 '22 00:10

Vit Khudenko