I started writing my first Android app, and chose SDK 2.0.1, before I had an android phone.
I wantto test the app on a phone that is Android 1.6. The app itself uses pretty simple stuff, so I'm sure its 1.6 compatible, but I want to change the SDK level from Eclipse.
The "default.properties" file in my project tree and naively tried to change from Android 6, but it isn't changeable, but if I try to change it it tells me to change the build.properties of the project. I don't know what that means. I'm not used to eclipse and am still fumbling around it.
I went to the project properties and clicked on "Java Build Path", but from there I don't know how to add,remove or edit the libraries.
Basically, I'm asking how to downgrade my project from inside eclipse, so I can export it to a compatible phone.
You can actually keep the project's targetSDK at the same level, and just use a minSDK value.
What this means is that your application will target to build against a certain API, but it will let phones with lesser versions of Android than that API to also run the app. The catch is that you have to make sure you don't make any API calls that don't exist in the older versions of Android.
To change this, go to your AndroidManifest.xml and add the following inside of the xml node:
<uses-sdk android:minSdkVersion="3" />
This would set your minsdk to Android 1.5. Change it 4 for Android 1.6 and so on.
But if you really want to change the TargetSDK, right click on your project --> properties. Then click the Android tab on the left. Then check the box of the target API you want to build against.
Some more versioning info can be found here.
You can change your the Build Target for your project at any time: Right-click the project in the Package Explorer, select Properties, select Android and then check the desired Project Target.
PS : I'm on Eclipse Helios
http://developer.android.com/guide/developing/eclipse-adt.html
Related
I downloaded an android project from code.google.com.
It is build in Android 2.2.Actually i want to add some functions in this project which were not available in 2.2 and that's why i want to upgrade it to 2.3
I change the Project Properties from Android API level 2.2 to 2.3 as mentioned here:
update Eclipse Android project to next version
After setting it to 2.3 API Level, i try to add functions of API level 2.3, but it is continuously giving me error that no such function found and asks to create methods within class.
Please help me experts...
You are changing only the build target of the Project. It will only change the target API in which the project is to be built. The project can still work in devices with API 2.2. So it will show an error when methods which are not compatible in lower versions are used.
To change it, take your manifest file and change the android:minSdkVersion to 9 (2.3).
go to project.properties in project folder.
And change target=android-8 to target=android-9.
And in Manifest change
android:minSdkVersion to 9.
Right click your project in the Project Explorer pane and select "Properties." The window that comes up and you can select a different platform target.
If your project reports some property related errors in the Problems pane, you can fix those by right-clicking your project again and selecting the Android Tools --> Fix Project Properties menu item:
There's a uses-sdk element in your AndroidManifest.xml file, the minSdkVersion attribute should always be set to something, especially if you're going to put your application in the Android Market. The corresponding API levels for Android are well documented.
I am using robotium tool in eclipse to create test cases.
My doubt is every time i make any changes in any of the file i get error like
Call requires API level 3 (current min is 1)... Android Lint Problem
and when i do right click on project and then android tools->clear lint markers
all those errors goes.But i am not getting why such lint errors comes on making any changes in the file?What is the reason for these lint errors.
You are using functionalities only available in newer API-levels than is your set minimum in android manifest file.
If you set <uses-sdk android:minSdkVersion="1" /> , you should not use any classes that were introduced in API-level 3.
I was having the same issue with Robotium and the lint markers. Instead of modifying any manifest files, I suggest disabling the minSDK lint check for your project that is using Robotium.
"Clear Lint Markers" removed the error temporarily, but it kept coming back every time I saved a file in the affected project.
Here's what worked for me:
Right click project -> Properties -> Android Lint Preferences
Search for "minSdk" in the search box
Click on "UsesMinSdkAttributes"
Click the "Ignore All" button at the bottom. Clean and rebuild the
project, and Eclipse/ADT will no longer run the lint check for minSdk
on your project.
Please refer this link. As it says,
Android Lint is a new tool introduced in ADT 16 (and Tools 16) which scans Android project sources for potential bugs. It is available both as a command line tool, as well as integrated with Eclipse (described below), and IntelliJ (details). The architecture is deliberately IDE independent so it will hopefully be integrated with other IDEs, with other build tools and with continuous integration systems as well.
gen folder is missing is the issue.The build patch failed .I have tried all solutions posted previously on this and no luck.
EDIT
To make it clear here is my original post
https://salesforce.stackexchange.com/questions/9460/encountering-issues-while-developing-android-hybrid-mobile-app
I am using salesforce SDK but when i am creating hello world app using native its working fine
Even if you delete the gen folder, it'll regenerate it after you compile your program.But if it is not then try creating a new project and try it again .If not , try a fresh installation of the API.
Update
Hmm, everyone in both posts is telling you to download the "SDK Platform" for "Android 2.2 (API 8)". I really, really recommend trying this. It is apparently required by the library you added to your project...
I have 4.2 and 4.1 .Is that not enough?
No, you must have the older platforms that you are building against.
Simply download it and open Project > Properties, click on Android, then select Android 2.2. After all this clean your project and save it.
Original Answer
The screenshot doesn't give us much detail, but:
Unable to Resolve target 'android-8'
Tells me that you probably don't have the SDK Platform for API 8, simply download this through the SDK Manager. Or you can change any references in your manifest and the rest of your code to use an API that you already have.
I think it is because when
you import a project, build
target is not set in the
project properties which
then default to the value
used in manifest file. and make sure you have API 8.
The solution is to enable
build target toward your
installed API level (but keep
the minimum api support as
specified in the manifest
file).
How to change the version of android application. i did entire code in Android 2.2 version, if i want to install the apk in 2.1 version, it getting parse error. How to change the versions of application. I dont know how to solve this issue. pls guide me to solve this problem.
if you are using eclipse it's very easy
go in eclipse project explorer
then right click on properties
select android from tree view
select your appropriate version.
and then in
in menifest file change
minsdk to 2.1
If you are using eclipse change value in manifest and build target in project configuration (Right click on project->Properties->Android-> Select that one which you need.
You have to also know that there can be some problems because of different version.
Check also this one Android Developer
I've been following the post:
http://tut7.com/2010/06/15/quick-tip-enabling-the-android-%E2%80%9Cmove-to-sd-card%E2%80%9D-feature/comment-page-1/#comment-6766
(even tried to post a comment but it's been awaiting moderation forever)...
I'm trying to target Android 1.6-2.2 OSs and after applying your Build Target I get the following warnings:
Attribute minSdkVersion (4) is lower than the project target API level (8) AndroidManifest.xml /CueBrain line 1 Android ADT Problem
And also, trying to launch my app in the 1.6 emulator it just ignores it and runs the 2.2 emulator.
What am I missing?
Are you building within Eclipse? You need to set the target SDK version within the manifest file (like the post you referenced shows), and you also need to set it within the Project settings in Eclipse.
On the main menu, go to Project --> Properties
Select the Android page
Check the box next to the target SDK you would like to build against
You should see the correct Android version in the Package Explorer as library. Mine is listed as "Android2.2" beneath the "src" and "gen" folders.