Android 获取版本号
来源:互联网 发布:c4.5算法python实现 编辑:程序博客网 时间:2024/05/16 15:19
http://blog.csdn.net/sunboy_2050/article/details/8024268
As described in the android documentation, the SDK level (integer) the phone is running is available in:
android.os.Build.VERSION.SDK_INT;
The enum corresponding to this int is in the android.os.Build.VERSION_CODES class.
Code example:
int currentapiVersion=android.os.Build.VERSION.SDK_INT;
if(currentapiVersion >= android.os.Build.VERSION_CODES.FROYO){
// Do something
}else{
// do something
}
Note:
This SDK_INT is available since Donut (android 1.6 / API4)
so make sure your application is not retro-compatible with Cupcake (android 1.5 / API3)when you use it or your application will crash(thanks to Programmer Bruce for the precision).
====================================================================================
Build.VERSION_CODES
1 (0x00000001) Android 1.0 BASE
2 (0x00000002) Android 1.1 BASE_1_1
3 (0x00000003) Android 1.5 CUPCAKE
4 (0x00000004) Android 1.6 DONUT
5 (0x00000005) Android 2.0 ECLAIR
6 (0x00000006) Android 2.0.1 ECLAIR_0_1
7 (0x00000007) Android 2.1 ECLAIR_MR1
8 (0x00000008) Android 2.2 FROYO
9 (0x00000009) Android 2.3 GINGERBREAD
10 (0x0000000a) Android 2.3.3 GINGERBREAD_MR1
11 (0x0000000b) Android 3.0 HONEYCOMB
12 (0x0000000c) Android 3.1 HONEYCOMB_MR1
13 (0x0000000d) Android 3.2 HONEYCOMB_MR2
Build.VERSION_CODES
参考推荐:
Android 获取屏幕尺寸与密度
- android app获取版本号,SDK获取版本号
- android 代码获取版本号
- Android获取版本号
- Android获取程序版本号
- Android 获取版本号
- Android获取版本号
- 获取Android系统版本号
- Android获取版本号
- 获取android.apk版本号
- Android 获取版本号
- Android 获取版本号
- Android获取版本号
- Android 获取版本号
- Android获取版本号
- Android 获取应用版本号
- Android 版本号等等获取
- android获取本地版本号
- 获取android版本号
- 写给想当程序员的朋友
- SQLServer跨库查询--分布式查询
- 视频帧率
- PostMessage
- Windows下Python中使用Opencv的配置方法
- Android 获取版本号
- 十大高明的Google搜索技巧
- vc 线程创建关闭
- Map-reduce 矩阵
- MongoDB介绍及下载与安装
- vpn and 本地的文件上传he下载
- Java程序员常用工具集
- Mysql常见命令行命令说明
- Spring Batch Framework– introduction chapter(下)