Android AndroidManifest.xml 四大组件注册方法

<uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <uses-permission android:name="android.permission.BROADCAST_STICKY" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.READ_SMS" />
    <uses-permission android:name="android.permission.WRITE_SMS" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:name=".MusicApplication" >

        //activity注册方法
         <activity
            android:label="@string/app_name"
            android:launchMode="singleInstance"
            android:name=".Day21_03_SmsActivity" >
            <intent-filter >
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            intent-filter>
        activity>

        //IntentService和service注册方法
        <service android:name=".MyService" >
        service>

        //这是BroadcastReceiver静态注册方法
        <receiver android:name=".SmsReceiver" >
            <intent-filter android:priority="1000" >
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
            intent-filter>
            <intent-filter >
                <action android:name="android.intent.action.BOOT_COMPLETED" />
            intent-filter>
        receiver>

        //音乐播放器通知栏的托盘界面
        <receiver android:name=".MusicAppWidgetProvider" >
            <intent-filter >
                <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
                <action android:name="com.aile.action.CURRENT_MUSIC_CHANGED" />
                <action android:name="com.aile.action.STOP" />
            intent-filter>
            <meta-data
                android:name="android.appwidget.provider"
                android:resource="@xml/musicprovider" />
        receiver>

        //ContentProvider注册方法
        <provider
            android:authorities="com.aile.provider.student"
            android:name=".StudentProvider" >
        provider>  
    application>

你可能感兴趣的:(android基础,android)