百度地图android客户端的AndroidMainfest.xml的学习和android版本号

平时写android产品相关的东西接触比较少,于是找个例子学习下。

众所周知,Apk文件是可以反编译的,虽然看不到代码,xml还是可见的。

把百度地图android客户端反编译之后,来学习下它的AndroidMainfest.xml。


 

<manifest android:versionCode="454" android:versionName="6.1.0" android:installLocation="auto" package="com.baidu.BaiduMap"
  xmlns:android="http://schemas.android.com/apk/res/android">
Google为APK定义了两个关于版本属性:VersionCode和VersionName,他们有不同的用途。
  • VersionCode:对消费者不可见,仅用于应用市场、程序内部识别版本,判断新旧等用途。
  • VersionName:展示给消费者,消费者会通过它认知自己安装的版本,提到的版本号大多都是说VersionName。

详细知识:http://blog.sina.com.cn/s/blog_580a227a0101bdzb.html

android:installLocation可以设置为"auto"、"internalOnly"、"preferExternal"三个值中的任何一个.

  • auto:程序可能被安装在外部存储介质上(例如:SD Card),但是默认会被安装到手机内存中.当手机内存为空时,程序将被安装到外部存储介质上.当程序安装到手机上后,用户可以决定把程序放在外部储介质还是内存中.
  • internalOnly:默认值.当设置为该值时,程序只能被安装在内存中,如果内存为空,则程序将不能成功安装.
  • preferExternal:将程序安装在外部存储介质上,但是系统不保证程序一定会被安装到外部存储介质上.当外部存储介质不可以或空时,程序将被安装到内存中.程序使用了forward-locking机制时也将被安装到内存中,因为外部存储不支持此机制.程序安装后,用户可以自由切换程序应该在外部还是内部存储介质上.

详细知识:http://www.cnblogs.com/Lefter/archive/2012/03/07/2383962.html



<
uses-sdk android:minSdkVersion="7" android:targetSdkVersion="14" />
  • android:minSdkVersion:即支持的最低版本
  • android:targetSdkVersion:targetSdkVersion 是设置希望的SDK版本,如果设置了此属性,那么在程序执行时,如果目标设备的API版本正好等于此数值,他会告诉Android平台:此程序在此版本已经经过充分测,没有问题。不必为此程序开启兼容性检查判断的工作了。也就是说,如果targetSdkVersion与目标设备的API版本相同时,运行效率可能会高一些。 但是,这个设置仅仅是一个声明、一个通知,不会有太实质的作用

Android 2.3---9===Gingerbread
Android 2.2---8===Froyo
Android 2.1---7===Eclair
Android 2.0.1---6===Eclair
Android 2.0---5===Eclair
Android 1.6---4===Donut
Android 1.5---3===Cupcak
Android 1.1---2 
Android 1.0---1  


 

<supports-screens android:anyDensity="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:resizeable="true" />

这个元素用于指定应用程序所支持的屏幕尺寸,并针对比应用程序所支持的屏幕还要大屏幕,启用屏幕兼容模式。在应用程序中使用这个元素指定应用程序所支持的屏幕尺寸是至关重要的。

<uses-permission android:name="android.permission.CAMERA" />

权限控制,此处略去

<activity android:theme="@style/BaiduMapTheme.Welcome" 
            android:label="@string/app_name" 
            android:name="com.baidu.baidumaps.WelcomeScreen" 
            android:launchMode="singleTop" 
            android:screenOrientation="portrait" 
            android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|fontScale" 
       android:noHistory
="true">

 android:configChange一般在AndroidManifest.xml文件中都没有使用到android:configChanges="keyboardHidden|orientation"配置,当然还是很有用的。
  就是如果配置了这个属性,当我们横竖屏切换的时候会直接调用onCreate方法中的onConfigurationChanged方法,而不会重新执行onCreate方法,那当然如果不配置这个属性的话就会重新调用onCreate方法了

 android:noHistory:当用户切换到其他屏幕时是否需要移除这个activity。这个属性是APIlevel3中引入的

 

  android:hardwareAccelerated="true":开启硬件加速

 

 

 

posted @ 2013-12-18 11:04  江海不系舟  阅读(1942)  评论(0编辑  收藏  举报