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

11.2. BootReceiver

In our Yamba application, the UpdaterService is responsible for periodically updating the data from the online service. Currently, the user needs to start the service manually, which she does by starting the application and then clicking on the Start Service menu option.

It would be much cleaner and simpler if somehow the system automatically started UpdaterService when the device powered up. To do this, we create BootReceiver, a broadcast receiver that the system will launch when the boot is complete, which in turn will launch our TimelineActivity activity. Example 11-1 sets up our broadcast receiver.


  

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