官术网_书友最值得收藏!

Getting familiar with Android Manifest

Every application must have an AndroidManifest.xml file and the file must have exactly that name. Its location is in its root directory, and, in each module, it contains essential information about your application to the Android system. The manifest file is responsible for defining the following:

  • Naming a package for the application
  • Describing the components of the application--activities (screens), services, broadcast receivers (messages), and content providers (database access)
  • Permissions that application must have in order to access protected parts of the Android API
  • Permissions that other applications must have in order to interact with the application's components, such as content providers

The following code snippet shows the general structure of the manifest file and elements that it can contain:

    <?xml version="1.0" encoding="utf-8"?> 
    <manifest> 
      <uses-permission /> 
      <permission /> 
      <permission-tree /> 
      <permission-group /> 
      <instrumentation /> 
      <uses-sdk /> 
      <uses-configuration />   
      <uses-feature />   
      <supports-screens />   
      <compatible-screens />   
      <supports-gl-texture />   
 
      <application> 
        <activity> 
          <intent-filter> 
            <action /> 
              <category /> 
                <data /> 
            </intent-filter> 
            <meta-data /> 
        </activity> 
 
        <activity-alias> 
          <intent-filter> . . . </intent-filter> 
          <meta-data /> 
        </activity-alias> 
 
        <service> 
          <intent-filter> . . . </intent-filter> 
          <meta-data/> 
        </service> 
 
        <receiver> 
          <intent-filter> . . . </intent-filter> 
          <meta-data /> 
        </receiver> 
<provider>
<grant-uri-permission /> <meta-data /> <path-permission /> </provider> <uses-library /> </application> </manifest>
主站蜘蛛池模板: 德庆县| 米泉市| 桑日县| 昌图县| 扬中市| 荆门市| 中牟县| 三门县| 长宁区| 石河子市| 镇原县| 尖扎县| 西畴县| 蒙阴县| 吕梁市| 和平区| 泾阳县| 河源市| 太和县| 铜川市| 高安市| 安义县| 麻江县| 安平县| 九寨沟县| 乐平市| 工布江达县| 宁阳县| 镶黄旗| 宝清县| 新建县| 平原县| 云梦县| 湖口县| 濮阳市| 海口市| 舟山市| 沂水县| 盱眙县| 马鞍山市| 景洪市|