Move to SD Card - android

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.

Related

android source not matching jar, in eclipse

I'm using Android 4.0.3 (API 15). When I stop in the debugger and step into the source for Android, the source isn't matching - that is, I end up some arbitrary number of lines outside of the function I stepped into. It appears that the SDK manager is downloading a version of source slightly different than the jar.
I tried uninstalling the jar (through the Android SDK Manager) and reinstalling. Same problem.
The Manifest points to version 15.
The java Build Path (project - properties) shows version 15.
when I hover over the tab for the particular android source file, it shows the correct path.
What am I missing?
One more comment: in the Java Build Path, it automatically adds an entry called "Android 4.0.3" even though I already added "android.jar". Regardless, the source paths are correct.
The answer is obvious in retrospect :) The source you use to debug has to match the version on your device, not the minimum version. The trick was getting Eclipse to "let go" of its source setting so I could point it to the correct version.

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

Changing the min. SDK version of an Android app

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

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