Upgrade Eclipse Project from 2.2 to 2.3 - android

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.

Related

Android Studio 3.3 disallows adaptive icons for SDK version less than 26

Just upgraded from Android Studio 3.2.1 to 3.3. Previously my project - targeting SDK v28 - built without problems, now I get this build error:
What went wrong: Execution failed for task ':app:processDebugResources'.
Android resource linking failed C:\app\src\main\res\mipmap-anydpi-v25\ic_launcher_round.xml: error:
<adaptive-icon> elements require a sdk version of at least 26.
error: failed linking file resources.
Obviously, I have an <adaptive-icon> resource in the mipmap-anydpi-v25 folder.
So, which AS version handles this correctly; 3.2.1 or 3.3? Should I remove my v25 icon? I thought Lollipop had support for this type of icons...
which AS version handles this correctly; 3.2.1 or 3.3?
Presumably 3.3, since adaptive icons were added in Android 8.0 (API Level 26).
Should I remove my v25 icon?
Change the directory to mipmap-anydpi-v26/, and you can still use that icon for Android 8.0+. If your minSdkVersion is below that (and I assume that it is), you will need an alternative implementation of the icon for the older devices.
I thought Lollipop had support for this type of icons...
Lollipop is Android 5.x, API Level 21-22. Your -v25 directory would not be used for those API levels.
For me, in AS 3.4, I had to:
It did not work for me to be able use add New | Image Asset due to the Adaptive Icons UNTIL I did that final step of remove SDK 25 from the list even after trying to correctly select the Project SDK and the Build Target.
I had tried several things and this was the final step that made it work for me. I don't know if this is particular to something in my configuration, but this got me past it.
I had the same problem, the reason was I messed up with the files manually but I didn't notice it until the update.
In my case, after update to AS 3.3, the files in conflict were:
drawable/ic_launcher_background.xml
drawable-v24/ic_launcher_foreground.xml
Although AS builds with without errors by changeing the min sdk "minSdkVersion 26" on app/build.gradle, it isn't practical for publishing purposes.
the easy quick solution was:
create a blank new project
copy the exact same files
and replace them in the conflicted project
Here is how i fixed it.
File -> Project Structure
Select Modules
Change compile SDK to above API 26 (optional i think)
Select tab Default Config and change target SDK version to above API 26
It shows an error when you have APIs less than 26 in SDK.
To remove Older APIs from SDK:
Click on File.
Select Project Structure.
Select SDKs inside Platform Setting.
In right side check if is there any older APIs showing then API 26.
Select Older APIs and click on Delete (-) Button.
Remove all older APIs than API 26.
Click on Apply and ok.
It will work :)

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

Move to SD Card

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.

Categories

Resources