Android 中的向前或向后兼容性?

发布于 2024-08-19 09:30:55 字数 262 浏览 11 评论 0原文

我想知道 Android 是否提供任何类型的兼容性,即向前或向后。这意味着,就像在 Blackberry 中一样,如果使用 JDE 4.2 开发应用程序,那么该应用程序将在任何具有 OS 4.2 或更高版本的手机上运行,​​这意味着它具有向前兼容性。 Android 中有类似的东西吗?

假设我使用 Android SDK 1.5 开发应用程序,那么该应用程序可以在任何操作系统为 1.5 或更高版本的手机上运行。

希望尽快得到答复。

谢谢&问候 苏尼尔

I would like to know whether the Android provides any sort of compatibility i.e either forward or backward. It means as in Blackberry if develop an Application with JDE 4.2 then that application will work on any handset with OS 4.2 or higher which means it has forward compatibility. Is there anything similar in Android?

Suppose I develop application with Android SDK 1.5 then will that application work on any handset having OS 1.5 or higher.

Hope to get a reply soon.

Thanks & Regards
Sunil

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

残龙傲雪 2024-08-26 09:30:55

主要版本的前向兼容性在一定程度上得到了保证。在 Android 上,您的目标是最低 api 规范。只要您不调用私有 API,Google 就会在加入其开放移动联盟的设备上保持兼容性。

这并不意味着有人无法获得 Android 源代码并发布自己的基于 Android 的操作系统,从而破坏所有兼容性。这些设备不会进入谷歌市场,因为只有谷歌测试的许可设备才能使用它。如果那是您要发布的地方,那么您可能不会遇到任何麻烦。

Forward compat is somewhat assured on major versions. On Android you target a minimum api spec. As long as your are not calling private APIs, Google keeps compatibility going forward on devices that join in on their Open Mobile Alliance.

It doesn't mean someone can't get the Android source and release an Android based OS of their own that breaks all compatibility. These devices wouldn't get Google's Market Place because only licensed devices that Google tests get to use that. If that is where you are releasing, you probably won't have any trouble.

说好的呢 2024-08-26 09:30:55

因为 Android 文档是根据 Apache 许可证获得许可的,所以我很乐意引用很大一部分内容:

Android 应用程序通常向前兼容新版本
Android 平台的版本。

因为几乎所有对框架 API 的更改都是附加的,
使用任何给定版本的 API 开发的 Android 应用程序(如
由其 API 级别指定)向前兼容更高版本
Android 平台和更高的 API 级别。申请应
能够在所有更高版本的Android平台上运行,除了
在孤立的情况下,应用程序使用 API 的一部分
后来由于某种原因删除了。

向前兼容性很重要,因为许多 Android 驱动的
设备接收无线 (OTA) 系统更新。用户可以
安装您的应用程序并成功使用它,然后收到
Android 平台新版本的 OTA 更新。一旦
安装更新后,您的应用程序将在新的运行时中运行
环境的版本,但具有 API 和系统
您的应用程序所依赖的功能。

...

Android 应用程序不一定向后兼容
Android 平台的版本早于所针对的版本
它们被编译了。

Android平台的每个新版本都可以包含新的框架
API,例如允许应用程序访问新平台的 API
功能或替换现有的 API 部分。

-- 来自: http://developer.android.com/ Guide/topics/manifest/uses-sdk-element.html

尽管 Android 应用程序向前兼容,但它们将无法使用编写后引入的 SDK 功能,这并不奇怪。

Because the Android documentation is licensed under the Apache license, I'm comfortable quoting a large section:

Android applications are generally forward-compatible with new
versions of the Android platform.

Because almost all changes to the framework API are additive, an
Android application developed using any given version of the API (as
specified by its API Level) is forward-compatible with later versions
of the Android platform and higher API levels. The application should
be able to run on all later versions of the Android platform, except
in isolated cases where the application uses a part of the API that is
later removed for some reason.

Forward compatibility is important because many Android-powered
devices receive over-the-air (OTA) system updates. The user may
install your application and use it successfully, then later receive
an OTA update to a new version of the Android platform. Once the
update is installed, your application will run in a new run-time
version of the environment, but one that has the API and system
capabilities that your application depends on.

...

Android applications are not necessarily backward compatible with
versions of the Android platform older than the version against which
they were compiled.

Each new version of the Android platform can include new framework
APIs, such as those that give applications access to new platform
capabilities or replace existing API parts.

-- From: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

Though they are forward compatible, Android apps will not be able to use features of the SDK that were introduced after they were written, not surprisingly.

叹沉浮 2024-08-26 09:30:55

这不是“向前兼容性”的意思。您正在考虑“向后兼容性”。 “向后兼容性”意味着新版本的平台(即Android)仍将运行针对旧版本平台开发的旧软件。 “向前兼容性”恰恰相反——针对旧版本平台开发的旧软件仍然能够利用新平台的功能。

向后兼容的一个例子是,他们重命名了 ICS 中的方法之一,但仍然实现了旧方法的已弃用版本,并将其转发到新的实现。

虽然几乎总是保证向后兼容性,但仅在某些情况下保证向前兼容性。向前兼容性的一个例子是这样的情况:他们在操作系统中实现了新功能(例如,“捏合缩放”),并且在该功能存在之前编写的应用程序仍然能够使用该功能。

That's not what "forwards compatibility" means. You are thinking of "backwards compatibility". "Backwards compatibility" means that new versions of the platform (i.e. Android) will still run old software developed against an older version of the platform. "Forwards compatibility" is the precise converse -- older software developed against an older version of the platform will still be able to leverage new features of the new platform.

An example of backwards compatibility is that they rename one of the methods in ICS but still implement a deprecated version of the old method and have it forward to the new implementation.

While backwards compatibility is almost always guaranteed, forwards compatibility is only guaranteed in certain scenarios. An example of forward compatibility would be a situatation where they implement a new feature in the OS (for example, "pinch to zoom") and applications written before that feature existed are still able to enjoy this feature.

南巷近海 2024-08-26 09:30:55

我认为Android系统是向后兼容的,这保证了Android应用程序的向前兼容性。

I think Android System is backward-compatible, and that ensures the forward compatibility of Android application.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文