是否可以在保持向后兼容性的同时使用最新的APP_PLATFORM? [英] Is it possible to use the latest APP_PLATFORM while still maintaining backward compatibility?

查看:65
本文介绍了是否可以在保持向后兼容性的同时使用最新的APP_PLATFORM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的Application.mk:

Here is my Application.mk:

APP_ABI := armeabi-v7a 
APP_PLATFORM := android-16
APP_OPTIM := release
APP_STL := gnustl_static
APP_CPPFLAGS := -std=gnu++11

APP_PLATFORM的值是android-16,因此我们可以支持Android OS 4.1及更高版本.

The value for APP_PLATFORM is android-16 so that we can support Android OS version 4.1 and above.

我知道在APP_PLATFORM设置为android-16的情况下,应用程序可以正常运行.这意味着我没有使用任何比android-16更新的Android功能.如果将其更改为android-19怎么办?由于我没有使用任何较新的Android功能,因此我认为代码在OS 4.1上仍然可以正常工作.请分享您的智慧.问候.

I know that the app builds fine withAPP_PLATFORMset toandroid-16. It implies that I am not using any Android functionality that is newer thanandroid-16. What if I change it toandroid-19? As I am not using any newer Android functionality, I am thinking the code should still work fine on OS 4.1. Please share your wisdom. Regards.

推荐答案

在android-16和android-19之间,仿生头没有变化(与android-21相比,它们发生了很多变化),因此您可以很好地针对android进行编译-19并在android-16设备上运行.

Bionic headers haven't changed between android-16 and android-19 (they changed a lot with android-21), so you may be fine compiling against android-19 and running on android-16 devices.

但是NDK平台不应该向后兼容.在比您的lib将在其上运行的平台更高的平台上进行编译是不正确的.

BUT the NDK platforms aren't supposed to be backward compatible. Compiling against an higher platform than the one your lib will run on isn't right.

属于NDK的所有平台均得到维护,并且已修复错误,因此,如果您不使用新功能,则没有理由针对更高的平台进行构建.

All the platforms that are part of the NDK are maintained and bugs are fixed, so there is no reason to build against a higher platform if you're not using new functionalities.

这篇关于是否可以在保持向后兼容性的同时使用最新的APP_PLATFORM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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