我需要一直使用最后targetSdkVersion? [英] Do I need to uses always the last targetSdkVersion?

查看:166
本文介绍了我需要一直使用最后targetSdkVersion?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

简单的问题:在Eclipse中新的Andr​​oid项目命令总是试图使用最后一个可用的SDK。是它总是一个好主意?

更新:

我试图解释。现在,在Eclipse中,新建项目产生了明显带有:

 <使用-SDK
    安卓的minSdkVersion =8
    机器人:targetSdkVersion =17/>
 

所以,目标到最后的And​​r​​oid(果冻豆,4.2.x版),但它可以在升级Froyo(2.2)也运行。这是确定我。我能做什么非常错误的这种选择?

更新

时,如果我设置好的安卓的minSdkVersion =8+安卓?targetSdkVersion =17和构建目标为2.2,以确保我的应用程序将运行在旧的手机(没有的NoSuchMethodError异常)

解决方案
  

我能做的非常错误的这种选择?

有没有错的选择,这就是为什么构建工具默认了。

设置 targetSdkVersion 您选择采用到具体的行为,你可能无法得到一个较旧的 targetSdkVersion 。您可以通过阅读的文档 Build.VERSION_ codeS

Simple question: In Eclipse "New Android project" command always tries to uses last available sdk. Is it always a good idea?

UPDATE:

I try to explain. Now in Eclipse, "New project" produces a manifest with:

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

So, target to the last Android (Jelly Bean, 4.2.x) but it can run also on Froyo (2.2). It's ok for me. What could I do very wrong with this choice?

UPDATE

Is it ok if I set android:minSdkVersion="8" + android:targetSdkVersion="17" and the build target to 2.2 to be sure my app will run on older devices (no NoSuchMethodError exception)?

解决方案

What could I do very wrong with this choice?

There is nothing wrong with this choice, which is why the build tools default to it.

Setting the targetSdkVersion opts you into specific behaviors that you might not get with an older targetSdkVersion. You can see some of what you get by reading the documentation for Build.VERSION_CODES.

这篇关于我需要一直使用最后targetSdkVersion?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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