可以将Android应用程序检查手机的版本 [英] can an android application check the version of the phone

查看:152
本文介绍了可以将Android应用程序检查手机的版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写使用动态壁纸为insatnce的应用程序。此功能仅在7及以上版本的支持。它是posiible,应用程序检查android手机的版本,并根据运行的不同code(例如使用动态壁纸或静态背景。)

I would like to write an application that uses live wallpapers for insatnce. this feature is supported only in version 7 and up. Is it posiible, that the application checks the version of the android phone and depending on that runs different code (e.g. uses live wallpaper or static background.)

你有一个code的例子吗?是否需要特殊的权限?

Do you have a code example for that? Does that require special permissions?

推荐答案

假设你需要的Andr​​oid 1.6或更高版本:

Assuming you're requiring Android 1.6 or newer:

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ECLAIR_MR1) {
    ...
}

这篇关于可以将Android应用程序检查手机的版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆