Changing the min. SDK version of an Android app - android

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

Related

Running android project

I made an app and after many days I want to run it again . Because of my project was on SVN for using the app I follow this steps :
1.File--> New--> Other--> SVN--> Project From SVN ... and so no
But when I right click on the project name to run it there isn't item call "1 android application"
when I want to config it for running ,in Android tab --> Project--> Browser I can't see my project and it's list is empty .
Also I can't find AVD for running on it (I made three AVD already...)
How can I fix it... :(
please guide me.
Thanks ;)
Ensure that your AVDs are running Android version with target API. For example if your project is for API 14+, no AVD with API < 14 will be listen on Target AVD list.
In the comments you told you are not seeing any Android tab in the project properties, you should be seeing something like this:
I would think then, that you do not have the Android SDK well configured, or your project is not set to be an Android Project.
Try re installing the Android SDK. Or creating a new Android project and copy all the files in that new project.

Upgrade Eclipse Project from 2.2 to 2.3

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 geting an error while building android project?

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).

update Eclipse Android project to next version

I have an android project in Eclipse I started developing in android version 2.2.? (i think). I want to update the project to run on my 2.3.3 device. Is there a way to upgrade the project or do I need to create a new one?
So based on your question... I just want to say that an Android 2.2 application will run on your 2.3.3 device without changes. (i.e., applications are forward compatible)
If you still want to change your platform version, read on.
Right click your project in the Project Explorer pane and select "Properties." The window that comes up will look like the following and you can select a different platform target.
If your project then 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 did this myself recently in the Eclipse IDE.
If you right click the project and view properties. There is a tag where you can select the target framework (2.2.?, 2.3.3, etc.) Unselect 2.2 and select 2.3.3.
At this point, if you were to save and reopen the project, it would tell you that some properties are messed up. If you right click the project again, and one of the last few menu buttons will have text along the lines of "Fix Project Properties". Click that option and afterwards everything should work correctly.
I can't add comments yet (apparently), but wanted to add to the above answer.
Yes, as noted above, you can edit project properties to bind to a new target android framework version. Under Properties, the heading on the left you want to pick is "Android". And you don't "unselect and select", you simply check the target framework you want (you can only have one active, they are really radio buttons, not checkboxes!).

Changing Android Project SDK level

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

Categories

Resources