Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2091364
  • 博文数量: 413
  • 博客积分: 10926
  • 博客等级: 上将
  • 技术积分: 3862
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-09 18:14
文章分类

全部博文(413)

文章存档

2015年(5)

2014年(1)

2013年(5)

2012年(6)

2011年(138)

2010年(85)

2009年(42)

2008年(46)

2007年(26)

2006年(59)

分类: 嵌入式

2010-12-29 16:54:20

  1. xx
  2. Components
    All components that will be created by Android system must be declared in Manifest, such as Activity, Service, Content providers, Broadcast receivers that initialized by system (such as BOOT_CIMPLETE), Broadcast receivers used by PendingIntent (Such as that used by AlarmManager). But the broadcast receivers register/unregister by yourself need not be declared in Manifest

      • android:taskAffinity
        Specify the id of task to house this Activity.

        Activities with the same affinity conceptually belong to the same task (to the same "application" from the user's perspective). The affinity of a task is determined by the affinity of its root activity.

        More details: http://blog.chinaunix.net/space.php?uid=8735300&do=blog&id=2211556
      • android:launchMode
        (
        http://developer.android.com/guide/topics/manifest/activity-element.html#lmode
        )

        "singleTask" and ""singleInstance", should be used ONLY when the activity has an ACTION_MAIN and a CATEGORY_LAUNCHER filter. (Please refer to the section 'Starting a task' at http://developer.android.com/guide/topics/fundamentals/tasks-and-back-stack.html)
        1. standard
          Default. The system always creates a new instance of the activity in the target task and routes the intent to it.
        2. singleTop
          If an instance of the activity already exists at the top of the target task, the system routes the intent to that instance, rather than creating a new instance of the activity. If instance doesn't exist, or the existing instance is not the top of the target task, the system will create a new instance
        3. singleTask
          If an instance of the activity already exists, the system routes the intent to existing instance, rather than creating a new one.
        4. singleInstance
          Same as "singleTask", except that the system doesn't launch any other activities into the task holding the instance. The activity is always the single and only member of its task.
      • android:configChanges
        Lists configuration changes that the activity will handle itself, rather than to shut down and restarte it by default.
      • android:screenOrientation
        Set the orientation of the activity's display.
        If you set its value to be 'landscape' or 'portrait', you'd better to append 'orientation' to 'android:configChanges' to prevent the activity benig restarted after system orientation is changed.
      • android:label
        A user-readable label for the activity. It will is displayed on activity's title. Furthermore, if the activity contains the following intent-filter:

           
           

        the label will be displayed on Program list as application's name.
        If this attribute is not set, that in will be used by default.
      • xxx
    • xxx
  3. Permission

    • Requests a permission that the application must be granted in order for it to operate correctly.

      Android pre-defines a list of permissions, you can find them at http://developer.android.com/reference/android/Manifest.permission.html

      If you need to request a permission defined by other application (not Android SDK), you must use to declare it in your AndroidManifest.xml first. ie, if a content provider application defines the following permission:


      android:name="xxxxx"
      android:authorities="xxxx"
      android:readPermission="com.xxx.provider.permission.READ"
      android:writePermission="com.xxx.provider.permission.WRITE">


      Your application need to read & write model the content provider, you must request permissions as following:



      com.xxx.provider.permission.READ" />
      com.xxx.provider.permission.WRITE" />
      com.xxx.provider.permission.READ/>
      com.xxx.provider.permission.WRITE" />


    • Declares a security permission that can be used to limit access to specific components or features of this or other applications.

    • Ref:
      http://developer.android.com/guide/topics/manifest/manifest-intro.html#perms
  4. Tips
    • Component name of inner class in Manifest
      Must use '$' instead of '.' between outter class and inner class. i.e.:

      package com.compony.utils;

      public class OutterClass extends AClass
      {
          public class InnerClass extends Activity
          {
             
          }
      }

      Then you can use the class OutterClass in Manifest as following:
      android:name="com.compony.utils.OutterClass$InnerClass"
    • xxx
  5. Reference:
    1. http://developer.android.com/guide/topics/manifest/manifest-intro.html
阅读(879) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~