问题描述
我在Android版本2.3中开发了一个应用程序,并希望将其转换为1.5. 不幸的是,我正在遇到一些问题.
我已经改变了minsdk从8到5 从属性的变化
但我仍然会出现问题.
任何想法?
推荐答案
如果您使用了在Android 1.5发布后添加的任何内置函数或方法或常量或属性,如果您尝试更改为1.5,则无法执行此操作.确保您没有使用此类方法或任何其他未在1.5中发布的属性.
其他推荐答案
转换应用程序版本号有几个方面.
-
稍后的Android版本,支持越多.功能是面向正面的相机支持,NFC支持,碎片或拖放等. 如果打算转换应用程序,请确保目标版本支持您需要的功能. 介绍各种API级别之间的主要差异强>.
-
使用每个新的Android版本更新Android API.这意味着可以在某些API级别上提供方法,常量和属性,但不可用其他API. 要查看哪个API级别,转到 Android文档在右上角,选择"通过API级别过滤".然后选择API级别.在完成所选API级别中未使用的所有API功能之后,将灰色,使其易于识别可用元素.如果您的代码包含目标级别不存在的元素,则会获得错误.
-
您需要明确地指定Eclipse中的两个(!)的android版本. 更改Eclipse中的Android项目的API级别:
a.打开项目清单并更改minsdkversion:
湾打开属性 - > Android,并更改项目构建目标(API级别).
通过清理您的项目(Project - > Clean ...)完成,以确保更新项目参考.
执行此操作后,更新API级别不可用的任何功能(方法,常量,属性等)将显示为项目中的错误.
修复这些错误,Google
Android <功能>
通常会导致您更换代码.
重新阅读后,我相信我发现了特定的错误:
你说你将minsdkversion设置为5. API级别5对应于Android版本2.0.
您还表示您希望将项目转换为Android版本1.5,这导致我相信您将项目构建目标设置为相应的API级别3.
如果更改其中的任何一个匹配另一个,应解决原始问题.
其他推荐答案
按顺序:
- 更改清单中的minSDK属性
- 编辑项目属性并更改目标平台,以确保您依靠好库
- 执行项目>清洁以确保,以确保您在R.java或为未来平台编译的二进制代码中没有旧常量
- 修复您的项目
- Optionnaly,将返回一些未来的代码,如移动到SD 中的SD 功能
问题描述
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:
- change the minSDKattribute in your manifest
- edit project properties and change the target platform, to ensure you rely on the good library
- 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
- fix your project
- optionnaly, place back some future code, like move to SD feature in the manifest