在Android的APP中必不可少的就是AndroidManifest文件:
词法:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="string" android:sharedUserId="string" android:sharedUserLabel="string resource" android:versionCode="integer" android:versionName="string" android:installLocation=["auto" | "internalOnly" | "preferExternal"] > . . . </manifest>
<manifest>是最大的元素,因此
包含于:
none 没有
必须包含的
可以包含的元素:
<compatible-screens>
<instrumentation>
<permission>
<permission-group>
<permission-tree>
<supports-gl-texture>
<supports-screens>
<uses-configuration>
<uses-feature>
<uses-permission>
<uses-sdk>
描述:
在AndroidManifest.xml文件中必须包含的元素是<application> 特定的xmlns:android
和
package
属性。
属性:
xmlns:android
定义了Android的名字空间,它的属性总是设置成:"
http://schemas.android.com/apk/res/android
".
package
和Java中的包名是一样的。这个名字应该是唯一的。这个名字可能包含大小写字母,数字以及下划线。但是一般单独的包值包含字母。
为了避免和其他开发者产生冲突,使用的包的名字应该使用你的互联网域名的所有权(反过来也是一样的).例如,由google发布的APP使用的是com.google。
当你准备发布一个APP的时候你不应该使用com.example
包名会作为唯一的应用程序的标识。对于应用程序默认的名字(参看
<application>
元素的process属性
)以及同类Activity
(参看
<activity>
元素 taskAffinity
的属性)的名字有默认的名字给它们。
注意:一旦你发布了你的应用程序,你变不可以修改你的包名。这个包名会作为应用程序的唯一标示,所以你一旦更改它,就被认为是不同的应用程序先前的版本就不能得到更新。
原文:http://blog.csdn.net/chichoxian/article/details/20065695