Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

6. The Way of the Service > Communication

Communication

There are two main ways to communicate with a service: intent broadcasts and binder interfaces. I’m going to show you examples of both and, along the way, let you see two practical tasks for a service. There are, in fact, many more ways you can communicate with your services. But in my experience, these are the two most useful. As always, check the documentation if neither of these approaches feels quite right for you.

Intent-Based Communication

Imagine two workers in different rooms who can only communicate with each other by email. These emails can contain attachments and other pieces of data. The two workers must get through their day using only this one method of communication. As you might imagine, this can be an efficient and functional way to get a multitude of things done, as long as they don’t have to say too much to each other.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint