Android apps can have many layers, or tiers. These include activities, fragments, services. Two tiers that know about each other, such an activity and a fragment, have many ways to communicate, using interfaces and callback methods. As an app gets more complex though, sending notifications can be more complex. Local broadcast messages are a way to send information anywhere in a particular app.
- [Instructor] I've previously described…how to listen for system broadcast messages,…but you can use a similar architecture to send…and receive messages that are only available…within your own app.…Android apps can have many layers or tiers.…These include activities, fragments, and services.…Two tiers that can communicate directly with each other,…such as an activity and a fragment,…have a number of ways to communicate using interfaces…and callback methods.…As an app gets more complex though,…sending notifications can get more difficult.…
Local broadcast messages are a way to send information…anywhere in a particular app.…I'll demonstrate this using this version of my application,…where I've added a class named MyIntentService.…An intent service is background service.…It runs on its own thread.…It runs to completion.…It doesn't stay in the background forever,…but it doesn't have direct access to an activity…that might have called it.…It can't call the activities methods.…So to send information from the intent service…
David also shows how to send and receive broadcast messages that let you exchange data and notifications among the different tiers of your application. He demonstrates how to work with menus and the action bar, add a navigation drawer to a layout, and tackle advanced navigation techniques. Later courses in the Essentials series concentrate on other specific skills you can master.
- Working with events
- Handling events with Java objects and lambda expressions
- Managing navigation
- Sending data to an activity
- Opening other apps with implicit intents
- Sending and receiving broadcast messages
- Working with menus and the action bar
- Adding a navigation drawer
- Advanced navigation techniques
- Removing activities from the back stack