gpt4 book ai didi

android - Android 构建目标对最终 APK 有什么影响?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:41:30 25 4
gpt4 key购买 nike

我的问题弹出了一个非常相似的问题,this one。但是接受的答案(唯一的)指向另一个问题 this one ,它并没有真正回答原始问题。

Android 文档指出:

The Build Target specifies which Android platform you'd like your application built against.

但这到底意味着什么?

在我看来,我可以使用 minSdkVersion=4targetSdkVersion=10 但将构建目标设置为 API 级别 4。会发生什么情况? Eclipse 假定我正在为 API 级别 4 进行开发,并且任何方法、常量或在 4 级以上的 API 级别上定义的任何内容都将对我不可用。如果我尝试使用它们,应用程序将无法编译。我知道这一点。

但让我换个说法...

假设我只设置了minSdkVersion=4targetSdkVersion没有定义。我也不使用任何仅在 API 级别 4 以上可用的方法或常量。在这种情况下,我选择的构建目标真的很重要吗?它会对最终的 APK 产生任何影响吗?

最佳答案

Build target

Build target is the API level Eclipse/IntelliJ/whatever IDE you’re using is building against. Thisis simply used by the IDE/build system to know which APIs to offeryou. If you build against API level 14, the application will still beable to run on API level 7, providing you don’t call any APIs that arenot available on API level 7.

I mostly set the build target to the same as android:targetSdkVersion,though this is not required.

来源:http://simonvt.net/2012/02/07/what-api-level-should-i-target/

关于android - Android 构建目标对最终 APK 有什么影响?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9899186/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com