Android Programming The Big Nerd Ranch Guide, 3rd Edition
For the More Curious: JobScheduler and JobServices 557 public class PollService extends JobService { @Override public boolean on ...
Chapter 28 Background Services 558 When onStopJob(...) is called, your service is about to be shut down. No waiting is allowed: ...
JobScheduler and the future of background work 559 JobScheduler and the future of background work In this chapter, we showed you ...
Chapter 28 Background Services 560 Sync adapters also integrate nicely with the OS from a user perspective. You can expose your ...
561 29. Broadcast Intents In this chapter you will polish PhotoGallery in two big ways. First, you will make the app poll for ne ...
Chapter 29 Broadcast Intents 562 Activities and services should respond to implicit intents whenever they are used as part of a ...
Creating and registering a standalone receiver 563 Next, open AndroidManifest.xml and hook up StartupReceiver as a standalone re ...
Chapter 29 Broadcast Intents 564 Time to verify that StartupReceiver’s onReceive(...) is executed when the device boots up. Fir ...
Using receivers 565 Using receivers The fact that broadcast receivers live such short lives restricts the things you can do with ...
Chapter 29 Broadcast Intents 566 Next, update PollService.setServiceAlarm(...) to write to shared preferences when the alarm is ...
Filtering Foreground Notifications 567 Filtering Foreground Notifications With that sharp corner filed down a bit, let’s turn to ...
Chapter 29 Broadcast Intents 568 Creating and registering a dynamic receiver Next, you need a receiver for your ACTION_SHOW_NOT ...
Creating and registering a dynamic receiver 569 Any IntentFilter you can express in XML can also be expressed in code this way. ...
Chapter 29 Broadcast Intents 570 Limiting broadcasts to your app using private permissions One issue with a broadcast like this ...
Limiting broadcasts to your app using private permissions 571 Now, use your permission by defining a corresponding constant in c ...
Chapter 29 Broadcast Intents 572 More about protection levels Every custom permission has to specify a value for android:protec ...
Passing and receiving data with ordered broadcasts 573 Right now you are sending your own personal private broadcast, but so far ...
Chapter 29 Broadcast Intents 574 Modify VisibleFragment to tell the sender of SHOW_NOTIFICATION whether the notification should ...
Passing and receiving data with ordered broadcasts 575 Listing 29.13 Sending an ordered broadcast (PollService.java) public sta ...
Chapter 29 Broadcast Intents 576 First, create a new BroadcastReceiver subclass called NotificationReceiver. Implement it as fo ...
«
25
26
27
28
29
30
31
32
33
34
»
Free download pdf