I am a new android developer and I am currently making an application to communicate with SIP. I would like to set a background task to do all the SIP related tasks and, if possible, let it begin when the phone is started. My current thoughts are creating a Service and letting it start on the device boot, the problem is that there are two kind of Services one that uses AIDL and one that is started with an Intent.
I would like to pass some arguments to my service and let it run independently of my main Activity and be able to notify my main Activity of incoming messages. Can anybody tell me how to do that and point me to any good tutorial where I can understand the difference between the two Services? I have read a book about and some tutorials including Android Developers, but they confused me even more.
That is incorrect. You use
Intentswith both local services and remote services. You only use AIDL with remote services.To pass “arguments” to the service, you could package those as “extras” via
putExtra()on theIntentyou pass tostartService()orbindService().To “notify my main activity of incoming messages”, you could use broadcast
Intentsand aBroadcastReceiverin the activity, or you could bind the activity to the service viabindService()and use listener objects.