Professional Documents
Culture Documents
unregisterReceiver(android.content.BroadcastReceiver)
Sending Broadcasts
• The three ways for apps to send broadcast:
1. sendOrderedBroadcast(Intent, String) –
– sends broadcasts to one receiver at a time
– It can completely abort the broadcast
– Order can be set by setting the priority
2. sendBroadcast(Intent) –
– sends broadcasts to all receivers in an undefined
order
– receivers cannot read results from other receivers
3. LocalBroadcastManager.sendBroadcast –
– sends broadcasts to receivers that are in the same
app as the sender
Sending Broadcasts
• Receiving
<receiver android:name=".MyBroadcastReceiver"
android:permission="android.permission.SEND_SMS">
<intent-filter>
<action android:name="android.intent.action.AIRPLANE_MODE"/>
</intent-filter>
</receiver>
IntentFilter filter = new
IntentFilter(Intent.ACTION_AIRPLANE_MODE_CHANGED);
registerReceiver(receiver, filter,
Manifest.permission.SEND_SMS, null );
Keep the device awake
• The following two methods do not require any special permission.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:keepScreenOn="true">
Keep the CPU on
• The following permission is required.
<uses-permission android:name="android.permission.WAKE_LOCK" />
• To release:
wakeLock.release();
Other Topics
• OpenGL ES
• Audio and Video
• Biometric Authentication
• Touch and input
• CameraX
• Web based content
• Google play services
• Android Games