Friends of the Union message push Note point:
Pushagent mpushagent = pushagent.getinstance (Mcontext);
Mpushagent.enable ();
Pushagent.getinstance (Mcontext). Onappstart ();
<?xml version= "1.0" encoding= "Utf-8"?> <manifest xmlns:android= "http://schemas.android.com/apk/res/"
Android "package=" com.jjjd.ee "android:versioncode=" 1 "android:versionname=" 1.0 "> <uses-sdk android:minsdkversion= "8" android:targetsdkversion= "/> <!--must be selected--> <uses-permission Andr Oid:name= "Android.permission.INTERNET"/> <uses-permission android:name= "Android.permission.ACCESS_NETWORK_" State "/> <uses-permission android:name=" Android.permission.ACCESS_WIFI_STATE "/> <uses-permission and Roid:name= "Android.permission.CHANGE_NETWORK_STATE"/> <uses-permission android:name= " Android.permission.CHANGE_WIFI_STATE "/> <uses-permission android:name=" Android.permission.READ_PHONE_STATE "/> <uses-permission android:name=" Android.permission.WRITE_EXTERNAL_STORAGE "/> <uses-permission and Roid:name= "Android.permission.WAKE_LOCK"/> <uses-permission andRoid:name= "Android.permission.VIBRATE"/> <uses-permission android:name= "Android.permission.WRITE_SETTINGS" /> <uses-permission android:name= "Android.permission.RECEIVE_BOOT_COMPLETED"/> <!--"Required" to set whether the foreground displays notifications --> <uses-permission android:name= "Android.permission.GET_TASKS"/> <!--optional--> <uses-perm Ission android:name= "Android.permission.BROADCAST_PACKAGE_ADDED"/> <uses-permission android:name= " Android.permission.BROADCAST_PACKAGE_CHANGED "/> <uses-permission android:name=" Android.permission.BROADCAST_PACKAGE_INSTALL "/> <uses-permission android:name=" Android.permission.BROADCAST_PACKAGE_REPLACED "/> <uses-permission android:name=" Android.permission.RESTART
_packages "/> <uses-permission android:name=" Android.permission.GET_ACCOUNTS "/>; <application android:allowbackup= "true" android:icon= "@drawable/ic_launcher" android:label= "@st Ring/app_nAme "Android:theme=" @style/apptheme "> <activity android:name=" Com.lxm.umengpushdemo.Mai Nactivity "android:label=" @string/app_name "> <intent-filter> <action Android:name= "Android.intent.action.MAIN"/> <category android:name= "Android.intent.category.LAUNCH" ER "/> </intent-filter> </activity> <!--pal--> <!--listening notification Click or suddenly
Slightly processed broadcast--> <receiver android:name= "Com.umeng.message.NotificationProxyBroadcastReceiver" Android:exported= "false" > </receiver> <!--monitor power-on, network connection changes, uninstalled broadcast--> <RECEI Ver android:name= "Com.umeng.message.SystemReceiver" android:process= ":p ush" > <i ntent-filter> <action android:name= "Android.intent.action.BOOT_COMPLETED"/> </int
Ent-filter> <intent-filter> <action android:name= "Android.net.conn.CONNECTIVITY_CHANGE"/> </intent-filter> <intent-filter> <action android:name= "Android.intent.action.PA Ckage_removed "/> <data android:scheme= Package"/> </intent-filter> & Lt;/receiver> <!--listening for message arrival broadcast--> <receiver android:name= "Com.umeng.message.Messag
Ereceiver "android:exported= false" android:process= ":p ush" > <intent-filter>
<action android:name= "Org.agoo.android.intent.action.RECEIVE"/> </intent-filter> </receiver> <!--broadcast--> <receiver android:name= "com.umeng.mess of the host election Age. Electionreceiver "android:process=":p ush "> <intent-filter> <action an Droid:name= "Org.agoo. android.intent.action.ELECTION_RESULT_V4 "/> <category android:name=" Umeng "/> <
/intent-filter> </receiver> <!--listening for registered broadcast--> <!--the application package name string requires the application package name of the replacement cost application--> <receiver android:name= "Com.umeng.message.RegistrationReceiver" android:exported= "Fals E "> <intent-filter> <!--Modify Application package name--> <action android:name=" c Om.jjjd.ee.intent.action.COMMAND "/><!--Com.jjjd.ee.intent.action.COMMAND cannot be. Intent.action.COMMAND, Package name to be consistent with Pagekage--> </intent-filter> </receiver> <receiver android:name= "com. Umeng.message.UmengMessageBootReceiver "> <intent-filter> <action android:name=" Droid.intent.action.BOOT_COMPLETED "/> </intent-filter> </receiver> <!--can root
It is necessary to set the service name in Android:label:--> <!--Umeng long service, which is used to establish the--> <!--the long connection of the push--> the application package name of the "Apply package name" string requires replacement cost application <service
Android:name= "Com.umeng.message.UmengService" android:exported= "true" android:label= "Pushservice"
android:process= ":p Ush" > <intent-filter> <!--Modify Application package name--> <action android:name= "Com.jjjd.ee.intent.action.START"/><!--Com.jjjd.ee.intent.action.START cannot be.
Intent.action.START, package name to be consistent with Pagekage--> </intent-filter> <intent-filter> <action android:name= "Com.jjjd.ee.intent.action.COCKROACH"/><!--Com.jjjd.ee.intent.action.COCKROACH cannot be
. Intent.action.COCKROACH, package name to be consistent with Pagekage--> </intent-filter> <intent-filter> <action android:name= "org.agoo.android.intent.action.PING_V4"/> <category Android:nam E= "Umeng"/> </inteNt-filter> </service> <!--Umeng message receiving service--> <service android:name= "
Com.umeng.message.UmengIntentService "android:process=":p ush "/> <!--Umeng Message routing service--> <service android:name= "Com.umeng.message.UmengMessageIntentReceiverService" android:exported = "true" android:process= ":p ush" > <intent-filter> <action android:name = "Org.android.agoo.client.MessageReceiverService"/> </intent-filter> <INTENT-FILTER&G
T
<action android:name= "Org.android.agoo.client.ElectionReceiverService"/> </intent-filter> </service> <!--v2.4.1 added Service,umeng processing service--> <service android:name= " Com.umeng.message.UmengMessageCallbackHandlerService "android:exported=" false "> <intent-fil Ter&gT <action android:name= "com.umeng.messge.registercallback.action"/> </intent-filter> &l
t;intent-filter> <action android:name= "Com.umeng.message.unregistercallback.action"/> </intent-filter> <intent-filter> <action android:name= "com.umeng.message.mess Age.handler.action "/> </intent-filter> <intent-filter> <action Android:name= "Com.umeng.message.autoupdate.handler.action"/> </intent-filter> </SERVICE&G
T <!--V1.3.0 added service, responsible for downloading the notification resources--> <service android:name= "Com.umeng.message.UmengDownloadResourceService "/> <!--V2.5.0 added service for local notification--> <!--If you do not use local alerts, you can comment out the configuration of the local notification service--> <servic E android:name= "Com.umeng.message.local.UmengLocalNotificationService" android:exported= "FALSE "/> <!--ally--> <meta-data android:name=" Umeng_appkey "Android:val Ue= "xxxxxxxxxxx" ><!--modified to your own umeng_appkey--> </meta-data> <meta-data android: Name= "Umeng_message_secret" android:value= "xxxxxxxxxxx" ><!--modified to your own Umeng_message_secret--> & lt;/meta-data> <meta-data android:name= "Umeng_channel" android:value= "Umeng" >< ;! --Modify yourself Umeng_channel--> </meta-data> </application> </manifest>