I got a question related to this.

I have an activity and a service. Right now they communicate via 2
connections with 2 binders like this:
Activity binds to Service
Service sets up callback binding to Activity
Activity calls remote function in service over AIDL-thing ... ...
Service loads current data from sqlite DB.
Service starts thread and does some work.
Service saves the new state into the sqlite DB.
Work-Thread on Service is done.
now : Service sends a notice back to the Activity telling the activity
the operation has completed.
This is either done by a callback if the Activity is still up or with
the  Notification-functionality ( the little icon thing on top of the
screen ), if the activity is down.
( note: when the activity goes down, the service learns of that fact.
so when the work-thread is done, I know about the state of the
Activity ).

now my question: Since the communication between my service and my
activity ( in either direction) is pretty simple ( just function
calls, no other data submitted), I was wondering if I could do the
thing simply by sending intents back and forth. I know how to send
intents from the Activity to the Service ( startService() ), but how
do I send intends the other way?
With  sendBroadcast(Intent intent)  from the Context - class?
I feel like if I could just send Intents back and forth it would make
things easier..

Or am I under a wrong impression here?

Any comments appreciated!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to