Broadcast Mechanism in Android Development
/*
* Broadcast mechanism for Android Development
* Beijing Android Club group: 167839253
* Created on: 2012-7-31
* Author: blueeagle
* Email: liujiaxiang@gmail.com
*/Overview
In Android,
("android.intent.action.MEDIA_UNMOUNTED".equals(action)) { System.out.println("SD卡被卸载了"); }}The note here is that we can onReceiver() get the action that triggers the broadcast by passing it to our object of intent intent.Introduction to some popular broadcasts
Auto start broadcast on boot
Android3.0 previously did not need to add permissions, after the 3.0 version a
Android. provider. telephony. the broadcast Intent when SMS_RECEIVED receives the SMS. ACTION_AIRPLANE_MODE_CHANGED; // broadcast Intent when flight mode is disabled or enabled. ACTION_BATTERY_CHANGED; // The charging status, or the battery power change // The battery charging status and charge level change. You cannot receive this
the device is currently set to be changed, please refer to Configuration.java
intent.action_date_changed;This broadcast is emitted when the device date has changed
Intent.action_device_storage_low;Broadcast when the device is out of memory, this broadcast can only be used by the system, other apps are not available?
INTENT.ACTION_DEVICE_STORAGE_OK;A
001 intent.action_airplane_mode_changed; 002//Broadcast When airplane mode is turned off or on003 004 intent.action_battery_changed; 005//charging status, or battery power change 006//battery charge status, charge level change, cannot receive this broadcast through the formation statement, only through Context.registerreceiver () registration 007 008 Intent.action_battery_low; 009//indicates low batte
Android has a very important feature, is broadcast. You can also consider broadcasting as a communication mechanism. Android Four components: Activity, Service, Broadcastreceiver and ContentProvider, only activity and service have a complete life cycle, other Broadcastreceiverand ContentProvider are not. Broadcastreceiver is essentially a listener responsible for
/**
* How to understand Broadcastreceiver (radio)?
* In fact, you can think of this, first we have to send a broadcast of the "media", in this case, we use the activity component as the media, of course, later
* Use service, or random start to send the broadcast, this depends on the business needs to decide.
* In this example, when the button is clicked,
1.Android Broadcast Mechanism overviewAndroid broadcasts are divided into two areas: the broadcast sender and the broadcast receiver, usually broadcastreceiver refers to the broadcast recipient (broadcast receiver).
I remember when I went to school, each class will have a speaker in the classroom, these speakers are connected to the school's broadcast room, once there is any important notice, will broadcast a radio to inform the teachers and students. Similar working mechanisms are also widely used in the computer field, if you understand the principle of network communicati
What is Broadcastreceiver?
Broadcastreceiver, a broadcast receiver, is a system global listener that listens to the global broadcast message of the system, so it can easily communicate between system components.
Broadcastreceiver is a listener, but it is different from the onxxxlistener used before, those are just program-level listeners, running in the process of the specified program, and when the progr
1.Broadcast Receiver Broadcast receiver brief introduction1.1. Definition
Broadcast receiver (broadcast receiver), one of the four components of Android
In Android development, br
1.Android Broadcast Mechanism overviewAndroid broadcasts are divided into two areas: the broadcast sender and the broadcast receiver, usually broadcastreceiver refers to the broadcast recipient (broadcast receiver).
Broadcast usage in Android 17th
Broadcast is a mechanism widely used to transmit information between applications. Broadcast in android is used to listen to system events or application events! Broadcast in
I. Overview of the Android broadcast mechanismAndroid broadcasts are divided into two areas: the broadcast sender and the broadcast receiver, usually broadcastreceiver refers to the broadcast recipient. Broadcast as a means of com
Broadcastreceiver
Broadcast recipient, one of the four Android components
To receive broadcast intent, the broadcast intent is sent by calling Sendbroadcast/sendorderbroadcast, usually a broadcast intent can be received by multiple
This article describes the Android based on the broadcast event mechanism to implement a simple timing reminders function code. Share to everyone for your reference, specific as follows:
1.Android Broadcast event mechanism
The broadcast event handling of
When talking about broadcasting, we first think of the Radio. When we want to listen to a broadcasting station, we only need to adjust the frequency of the radio to the frequency of the broadcasting station! The broadcast in Android is actually very similar to the radio, but
. registerReceiver. The registered broadcast receiver is equivalent to an anonymous class. Both methods require IntentFIlter.
IntentFilter intentFilter = new IntentFilter (); intentFilter. addAction (String); // specify the action for BroadcastReceiver to receive the broadcast registerReceiver (BroadcastReceiver, intentFilter) of the same action );
GENERAL: Register in onStart and cancel unregisterReceiver
Original address: http://blog.csdn.net/liuhe688/article/details/6955668/
Broadcastreceiver is the "broadcast receiver" meaning, as the name suggests, it is used to receive from the system and applications in the broadcast.
In the Android system, broadcast in all aspects, for example, when the system is completed after
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.