How to add jar in Eclipse to update the version ? - android

I made my app for Android 4.3 and I'm almost done with that but now I want to upgrade it for Android 4.4.
Will it work by adding android.jar ?

Steps to perform it.
Download latest version of android i.e Andriod 4.4 (API 19) using Android SDK manager.
Right Click your Project -> Properties -> Android -> Select desired API level
Update your Android Manifest file with min, max and target SDK support
You can not change android.jar file directly. You need to perform step 2 to do so.

No, it will not work ... you need to update the SDK with Android SDK manager first. Then update the Eclipse ADT plugin and then go to your Android project, set the Android project build path to 19 and change the targetSDK to 19 as well in the Manifest.
The android.jar JAR file does not contain the Android framework code, but only stubs for the type signatures, methods, types, etc. The android.jar JAR file is only used for the Java compiler before deployment on an Android device. It is not bundled with your application. Once your application is deployed on the device / emulator, it will use the android.jar JAR file on the Android device. Calling methods from the android.jar JAR file throw a new RuntimeException("Stub!").

Related

Unity requires Android SDK to be minimum API level 21

So I've been trying to build a Unity 4.6.1 project in Android, but the problem is that my Android SDK is outdated. However, I believe Google discontinued support of the traditional ADT to switch to Android Studio. Android Studio doesn't have an easy to find SDK folder in version 1.0.1. This is the error I get: "Error building Player: UnityException: Minimum platform required is Android 5.0 (API level 21)" How do I build my Unity project for Android, if the ADT doesn't have support for API level 21?
Click on the SDK manager button (on the top) and in a grayed out text on top of the window (which looks like it did in ADT) it should show you the location of your SDK(e.g. C:\users\admin\appdata...) . And you can change that location in the settings. Just remember to move the files.
1) Download SDK Tools (v25.2.5) from http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
2) Extract in a folder and navigate inside.
3) run android.bat which would open SDK Manager.exe. Update the packages from this tool (must done step). You can also install any specific API if required in your unity project.
4) In Unity, Go to Edit -> Preferences -> External tools and update path for JDK and the path of the folder where you extracted SDK Tools.
Now Unity would build for android without any issues.

Upgrading the SDK to a newer SDK

I have an app running on android 2.1 and I would like to update it to android 3.2 as I do not have anyone using that version. How do I go about doing that? I changed the min sdk in manifest but I was wondering about the JAR file. Do I download the jar for that version. Do I keep the old jar.
Thanks
Prerna
It doesn't matter what the Android version is of the jar file. That is only what target the application compiles with. If you want to change that, click on your project, File -> Properties -> Android and check the desired project build target (i.e. 3.2) and Apply.

Android SDK build tools

If i have two or more version of android sdk build tools as shown below then when which one will be chosen by the eclipse while building. IS it anything to with the SDK platform chosen for developing apk.
Here which one will be used either 17 or 19?
The build tools specifies the toolchain used to build Android projects. In Eclipse you can change which version is used with the project.properties file by specifying sdk.buildtools, e.g.
sdk.buildtools=17.0.0
You will probably never need to do that, as it will use the most recent installed version by default. It is not tightly coupled to the SDK version, and has only been recently split apart from the SDK itself (since version 17).
If there are different versions for Android SDK Build Tools , By default eclipse uses the most recent version of the Android Build Tools.
But if your project requirement belongs to different version(may be older) , you can do this using following steps.
In the root folder of your application project, find the project.properties file.
Open the file and specify the Build Tools version by adding a build-tools property on a separate line:
e.g. sdk.buildtools =17.0.0

how to add target build in eclipse?

I currently have an Android project in Eclipse.
I need to change target build in Project properties
but there is only Android 4.4 in the list
how can i add another target ? for example 2.1 or 2.2
In the list it only shows the SDKs that you have installed. If you want to build application with a specific version then in SDK manager download the SDK first and then use that for making a build.
Generally we make build only with the latest version. Why do you want to make a build with other version? If you want to support older version like 2.2 then you have to set that in minSdkVersion in your manifest file.

How can I tell which Android Support Library v4 revision I use?

I can see in the Android SDK manager the version installed on my computer (in Android SDK manager), but usually a project uses its own copy from the libs folder.
Is there a way I can tell which version is the android-support-v4.jar being used in a specific project besides the file date?
Any method is considerable - by code / eclipse / file manager
in eclipse package explorer right click in your project
select android tools -> Add supported Library
there you see which supprt library revision id you have, in my case is 11
Take the md5 hash of the jar in your app's libs directory.
Compare it to the hashes of support library jar files to work out exactly which one you're using.
e.g. to generate hashes you could use: http://nule.org/wp/?page_id=86
run this from a batch file with:
java -jar JMd5Sum.jar
when you are selecting android Tools -> Add support Library option .it has automatically added compatible v4 library .android os is telling which one is compatible with your project.
If you wants to add particular version of any jar .firstly you have downloaded and put manully in libs folder then it added as external jar.
Build a SHA1 hash of the support library v4 jar file and compare the result with the listed hashes here: http://www.smartphoner.org/2014/11/23/android-support-library-v4-revisionen-und-hashes/
Nower days the actual support library revision is equal to the api level of the newest android version. Currently this is 21 (Lollipop).
Android SDK can show the version of Android support Repository, and make sure you download Android Support Repository by using Android SDK Manager.
If you really want to add an old support lib, you can check the version under Android studio. Right click your project, select "Open Module Settings" -> then select your app modules -> "Dependencies" . You can check your support lib version.

Categories

Resources