You can communicate between the different layers of your Android app—activities, fragments, services, and so on—with broadcast messages. EventBus is an open- source library that lets you send and receive these messages with tiny amounts of code.
- [Instructor] In a previous tip, I described…how to use an intent service to manage a background task.…And I showed how to quickly create an intent service…using Android Studio and how to add code…to start and manage the task.…In this tip, I've cleaned up that code a bit…so I'm only managing a single task.…And in the handleActionFoo method,…in the MyIntent service class, I'm logging messages…using logcat output.…Now I'm going to show you how to communicate back…from the intent service to the user interface,…which could be an activity or a fragment.…
An intent service doesn't have a direction connection…back to the user interface.…So you have to send messages using a broadcast message.…You could use the local broadcast manager class…that's a part of the support library.…And I've shown how to use that in a couple of courses.…But in this tip,…I'm going to describe how to use…a third party open source product…called EventBus.…This library can help you manage broadcast messages…that you can send from anywhere to anywhere…
Skill Level Intermediate
Q: Why can't I earn a Certificate of Completion for this course?
A: We publish a new tutorial or tutorials for this course on a regular basis. We are unable to offer a Certificate of Completion because it is an ever-evolving course that is not designed to be completed. Check back often for new movies.
Android App Development: Data Persistence Librarieswith Annyce Davis4h 52m Intermediate
Building Android Apps with Cloud Serviceswith Albert Lo2h 37m Intermediate
1. Android Development Tips Weekly
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.