将 Android 版本 2.3 转换为 1.5

发布于 2024-11-27 06:43:41 字数 129 浏览 1 评论 0原文

我在Android 2.3版本中开发了一个应用程序,想将其转换为1.5版本。 不幸的是我遇到了一些问题。

我已将 minSDK 从 8 更改为 5 从属性更改

但我仍然遇到问题。

有什么想法吗?

I have developed one application in Android version 2.3, and want to convert it into 1.5.
Unfortunately I am experiencing some problem with that.

I have changed minSDK from 8 to 5
changed from property

But I still get the problem.

Any ideas?

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

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

发布评论

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

评论(5

花海 2024-12-04 06:43:41

转换应用程序的版本号涉及多个方面。

重新阅读问题后,我相信我发现了具体错误:

您说您已将 minSdkVersion 设置为 5。API 级别 5 对应于 Android 版本 2.0。

你还说你想将你的项目转换为 Android 版本 1.5,这让我相信你已经将你的项目构建目标设置为相应的 API 级别 3。

如果你更改其中一个以匹配另一个,你原来的问题应该得到解决。

There are several aspects to converting an application's version number.

  • The later the Android version, the more features are supported. Features are things like front-facing camera support, NFC support, Fragments or Drag and drop.
    If you plan to convert an application, make sure that the target version supports the features you need. This describes the major differences between the various API levels.

  • The Android API is updated with each new Android version. This means that methods, constants and attributes can be available on some API levels, but not on others. To see what is available in which API level, go to the android documentation and in the upper right corner select 'filter by api level'. Then select an API level. After you do that all API features that weren't available in the selected API level will be grayed out making it easy to identify the available elements. If your code contains elements that don't exist in the targeted level, you will get errors.

  • You need to explicitly specify the Android version in two(!) places in Eclipse.
    To change the API level of an Android project in Eclipse:

    a. Open the project manifest and change the minSdkVersion:

    b. Open Properties -> Android, and change the Project Build Target (API level).

    Finish by cleaning your project (Project -> Clean...) to ensure that the project references are updated.

    After doing this, any features (methods, constants, attributes, etc.) not available in the updated API level will show up as errors in your project.

    To fix these errors, Google

    android < feature> < API level>

    which will often lead you to replacement code.

After re-reading the question I believe I've found the specific mistake:

You say you've set the minSdkVersion to 5. API level 5 corresponds to Android version 2.0.

You also say you want to convert your project to Android version 1.5, which leads me to believe that you've set your Project Build Target to the corresponding API level 3.

If you change either of those to match the other, your original problem should be solved.

浅语花开 2024-12-04 06:43:41

按顺序:

  1. 更改清单中的 minSDK 属性
  2. 编辑项目属性并更改目标平台,以确保您依赖良好的库
  3. 执行项目>干净以确保,以确保您在 R.java 中没有旧常量,或为未来平台编译的二进制代码
  4. 可以选择修复您的项目
  5. ,放回一些未来的代码,例如移动到 SD清单中的功能

In order:

  1. change the minSDKattribute in your manifest
  2. edit project properties and change the target platform, to ensure you rely on the good library
  3. do a Project > Clean to ensure, to ensure you don't have old constants in R.java or binary code compiled for a future platform
  4. fix your project
  5. optionnaly, place back some future code, like move to SD feature in the manifest
枕梦 2024-12-04 06:43:41

向后转换意味着您必须编写替代代码来替换在旧版本 SDK=5 中不支持的高版本 SDK=8 中使用的 api 方法,因为在旧版本中这些方法将不存在。

如果您提前计划支持的最低版本,那就更好了。

To convert backward means that you have to write alternative code to replace method for api you used in the higher version SDK=8 that aren't supported in the old SDK=5, because in the old version those methods won't exist.

It is better if you plan ahead witch minimum version to support.

心如狂蝶 2024-12-04 06:43:41

右键单击 Eclipse 中的项目,转到“属性”,转到“android”,然后将构建目标设置为 1.5。

Right click the project in eclipse, go to Properties, go to android, and set the build target to 1.5.

九公里浅绿 2024-12-04 06:43:41

如果您使用过 android 1.5 发布后添加的任何内置函数或方法或常量或属性,并且现在尝试更改为 1.5,您将无法做到这一点。确保您没有使用此类方法或 1.5 中未发布的任何其他属性。

If you have used any inbuild functions or methods or constants or attributes that was added after the release of android 1.5 and if you try to change to 1.5 now, you will not be able to do that. Make sure that you have not used such kind of methods or any other attributes that was not released in 1.5.

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