zoukankan      html  css  js  c++  java
  • 百度地图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":开启硬件加速

  • 相关阅读:
    spring@Async注解实现异步方法调用
    mysql锁机制
    springboot启动时执行任务CommandLineRunner
    java-并发编程之fork/join框架
    mysql explain 执行计划详解
    mysql 时间相关sql , 按天、月、季度、年等条件进行查询
    swagger2 常用注解说明
    VirtualBox 安装CentOS虚拟机网卡配置
    RestFul是啥
    文本内文字字数过多,显示省略号
  • 原文地址:https://www.cnblogs.com/wangcan/p/3479921.html
Copyright © 2011-2022 走看看