将安卓2.3版本转换为1.5版本[英] Converting Android version 2.3 to 1.5

本文是小编为大家收集整理的关于将安卓2.3版本转换为1.5版本的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

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

我已经改变了minsdk从8到5 从属性的变化

但我仍然会出现问题.

任何想法?

推荐答案

如果您使用了在Android 1.5发布后添加的任何内置函数或方法或常量或属性,如果您尝试更改为1.5,则无法执行此操作.确保您没有使用此类方法或任何其他未在1.5中发布的属性.

其他推荐答案

转换应用程序版本号有几个方面.

重新阅读后,我相信我发现了特定的错误:

你说你将minsdkversion设置为5. API级别5对应于Android版本2.0.

您还表示您希望将项目转换为Android版本1.5,这导致我相信您将项目构建目标设置为相应的API级别3.

如果更改其中的任何一个匹配另一个,应解决原始问题.

其他推荐答案

按顺序:

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

本文地址:https://www.itbaoku.cn/post/102683.html

问题描述

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?

推荐答案

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.

其他推荐答案

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.

其他推荐答案

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