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

Wrapping Up

In this chapter, you learned how to use a simple foreground service to notify you when a photograph is added to Android’s ContentProvider. You learned how to start it, place it in the foreground with a notification, and then kill it off when the user no longer wanted it to run. Next, I went from the simple to the complex and showed you how to communicate directly with a service across process boundaries. You did this by creating an AIDL interface, implementing a stub, and then using a ServiceConnection and a bindService call to establish a connection with the service.

The first example was a simple service that does only one thing, while the second example you stormed through was one of the more complex mechanisms that Android can provide. If your arms are long enough (and you’re not a Tyrannosaurus rex), give yourself a resounding pat on the back.


  

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