Android - Service and Activity interaction

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2010-06-17T21:39:01Z Indexed on 2010/06/17 21:43 UTC
Read the original article Hit count: 373

Filed under:
|
|

I want to create an app that contains a Service S and an Activity A. The Service S is responsible for preprocessing, such as preparing the data shown on the UI of the Activity A, before the Activity A gets invoked.

I want to be able to invoke the Service S from outside the package, say from another Android app's Activity class B, do the preprocessing, and then when the data is ready, invoke Activity A.

My questions are:

  1. What is the best way to share data between the Service S and Activity A?
  2. How can the external activity B communicate with the Service S to determine if it has completed with all its preprocessing, and the Activity A is ready to be invoked?

Thanks Chris

© Stack Overflow or respective owner

Related posts about android

Related posts about service