音乐播放器-manifest分析

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.easymusic"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="14"
        android:targetSdkVersion="17" />
    <!-- 访问网络权限,要通过访问网络获取歌词信息 -->
    <uses-permission android:name="android.permission.INTERNET" />
    <!-- 向外部存储卡写权限,需要将歌词等写入 sd卡 -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <!--
        Application是用来设置存放全局变量的通过getApplicationContext()访问 , 通过name可以知道是哪个,应用通常只有一个
        	allowbackup是允许备份,如果不允许就算是系统也不会备份
    -->
    <application
        android:name=".MusicApp"
        android:allowBackup="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >

        <!--
        由于screenOrientation是portrait所以只会竖屏 
        actionbar是在android后来的额版本加上的,类似导航栏
                 通过intent-filter过滤让谁启动,比如第一个Activity是用Main启动的
        category设置该组件为在当前应用程序启动器中优先级最高的Activity,通常为入口ACTION_MAIN配合使用。
	icon需要从源文件的图标drawable_hdi里面导入到该drawable-hdpi里面否则会报错
        -->
        <activity
            android:name=".activity.MainContentActivity"
            android:label="@string/app_name"
            android:launchMode="singleTask"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <!--
        <activity android:name=".activity.MainContentActivity"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar">
            
        </activity>
        -->
        <activity
            android:name=".activity.MenuBackgroundActivity"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" >
        </activity>
        <activity
            android:name=".activity.MenuScanActivity"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" >
        </activity>
        <activity
            android:name=".activity.MenuSettingActivity"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" >
        </activity>
        <!--
在launchmod里面standard是默认的,下面是standard和singletop的区别   
简单来讲就是如果已经存在该instance singletop就不再重新创建
      The "standard" and "singleTop" modes differ from each other in just one respect: 
Every time there's a new intent for a "standard" activity, a new instance of the class is
 created to respond to that intent. Each instance handles a single intent. Similarly, a 
 new instance of a "singleTop" activity may also be created to handle a new intent. However, 
 if the target task already has an existing instance of the activity at the top of its stack,
  that instance will receive the new intent (in an onNewIntent() call); a new instance is not created. 
  In other circumstances — for example, if an existing instance of the "singleTop" activity 
  is in the target task, but not at the top of the stack, or if it's at the top of a stack, 
  but not in the target task — a new instance would be created and pushed on the stack.
        -->
        <activity
            android:name=".activity.PlayQueueActivity"
            android:launchMode="singleTop"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Holo.Light.Dialog.NoActionBar" >
        </activity>
        <!--
        windowSoftInputMode属性设置软键盘的显示模式,就是输入法的显示模式,通常2种statevisable和 stateHidden
        默认的是stateUnspecified就是可根据系统设置调节的的输入法显示
        -->
        <activity
            android:name=".activity.MusicListSearchActivity"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden" >
        </activity>
        <!--
给service设置action这样能通过隐式意图启动service
四大组件其中的3大都需要在manifest里面声明,尽管contentprovider通常不用
然后broadcastReceiver代码和manifest里面都行
隐式意图可以设置多个action
        -->
        <service android:name=".service.MediaService" >
            <intent-filter>
                <action android:name="com.example.easymusic.service.MediaService" />
            </intent-filter>
        </service>
    </application>

</manifest>


然后有人会问这么多你在哪里知道的?

       首先打开开发官网http://developer.android.com/index.html#,然后搜索manifest,得到http://developer.android.com/index.html#q=manifest,第一个选项就是,左侧的导航栏将引导你找到自己想要的东西,然后就动下自己从小学学到大学的英语吧。

      当然google的网页翻译和有道词典的取词功能能带来很大的方便。






  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值