I developed one simple android application targeting the Mobiles with android 2.0 OS.I want to know whether i can run the same application in android 1.5 .If any body knows it please help me out.
In your AndroidManifest.xml file (located in the base of the project) there's a tag called uses-sdk
<uses-sdk android:minSdkVersion="3" android:targetSdkVersion="5" />
Those numbers are known as API level where 3 is for Android 1.5 and 5 is for Android 2.0.
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
Note that this allows you to compile your code against the 2.0 SDK but if you use classes or functionality in your app that is not supported in 1.5 then it will crash. I recommend that you create an AVD for 1.5 and 1.6 for testing.
You may want to consider just compiling against 1.5 for simplicty.
Lastly, a common trick is to compile against 2.0 and avoid/disable features that aren't supported in earlier versions of android the following article shows how do this.
http://developer.android.com/resources/articles/backward-compatibility.html
Related
This is probably very basic but I have failed to find information on how to do this. On iOS I have a base SDK and a target SDK so I can use the latest features from the base SDK (of course check if they are available first) and at the same time make my app run on devices with the target SDK. How can I do the same thing with Android in Eclipse, how can I compile with Android 4.1 and at the same time make my app run on (deploy to) Android 2.3?
Im not asking about checking which version I am running at run time, but how do I configure Eclipse correctly.
Thank you
Søren
Start by reading backward compability on Android developer site. You are probably looking for "Set Minimum and Target API levels".
On your Androidmanifest.xml check for the uses-sdk tag
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" />
version 8 is Android 2.2 up to 16 for 4.1/4.1.1
from here
I'm downloading Android SDK , and want to know if Android's APIs has compatibility with its
Previous versions ? i.e. if i installed Android API 16 can I use the application on
Android 4.0 (API 14) ?
You can run older API versions on newer systems, but not vice-versa. For example Android 4.0 can run programs made for Android 2.3.3, but Android 2.3.3 can't run Android 4.0 programs.
You have to define a minimum sdk level in your android manifest. Every version from this upwards supports the app. You can only use classes and language elements that are supported by this specified version.
This is controlled by the following in your manifest file:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
This means:
1) your app won't run on any Android whose version < 8.
Android OS whose version < 8 will not let your app be installed.
2) Your app is using Android API as of Android version 15.
In your code you can, however, check the Android version (using Build.VERSION.SDK_INT) and if it is < 15 then do not run certain code.
This is often done so the app can use newer features if run on newer Android versions yet it can run on older versions as well.
Not all components are backwards compatible, but for backwards stuff, look at the following
I found the most useful library out there for making an android app backwards compatible.
Its called Actionbarsherlock, it gives you all android 4.1+ functionality all the way back to 2.1 (what i am developing as a min version)
Its fairly simple to use, very well explained on their website:
http://actionbarsherlock.com/
Enjoy
I've built an Android application in eclipse. Before starting the project I selected the 2.3.3 api. The code is very basic.
A friend of mine asked to have a copy, but he's using 2.2, do I have to rebuild the project in 2.2 or will it work just fine if I send him the APK build with the 2.3.3 api?
change
<uses-sdk android:minSdkVersion=.... />
in the android manifest to
<uses-sdk android:minSdkVersion="8" />
Change the Project Build Target to 2.2, in the Properties Menu of your project in the Android drill down.
You should only get errors if you used methods that were introduced with the level 10 API (Android 2.3.3). Since you pointed out that your application is very basic, I highly doubt you'll run into major problems.
From the docs
Selecting a platform version and API Level
When you are developing your application, you will need to choose the platform version against which you will compile the application. In general, you should compile your application against the lowest possible version of the platform that your application can support.
You can determine the lowest possible platform version by compiling the application against successively lower build targets. After you determine the lowest version, you should create an AVD using the corresponding platform version (and API Level) and fully test your application. Make sure to declare a android:minSdkVersion attribute in the application's manifest and set its value to the API Level of the platform version.
So in short, you'll have to recompile it
If you go to the properties for your project and then select the Android dialog, you can change the API which your project is using. Provided you have have it installed.
In the AndroidManifest file set android:minSdkVersion to 7. In this way you force it to run in compatibility mode on devices that have lower version than the target mode(which is 8 in your case).
I want to make application that support 2.1 or higher platforms. Does anyone have solution for it?
Can I use somekind of cross-platform for it or cross-platefroms are only for porting applications from differnt OS? Or there is any library i can use for this purpose?
Any application built with Android 2.1 API will work later versions of Android (theoretically). In the AndroidManifest.xml file, set the target SDK version to 2.1, and the 2.1 API will be loaded by Eclipse for the application. Done. It's still recommended to test it on later versions in case there's some slight variations that aren't documented, but most if not all things should work.
Just code your application and in your AndroidManifest put this somewhere <uses-sdk android:minSdkVersion="7" />.
That corresponds to Android 2.1, more details here http://developer.android.com/guide/appendix/api-levels.html
Is it possible to run android 3.1 application to run in android 2.1 device? I heard that there is a compatibility in android. And I used API level 3.1 in my application.
There are two things: the compatibility mode: http://developer.android.com/guide/practices/screen-compat-mode.html and the compatibility libraries: http://developer.android.com/sdk/compatibility-library.html
The compatibility mode takes care of adjusting the screen to fit the device on post-3.0 devices even if the app has not been tailored for the specific screen. The compatibility library ports some of the Honeycomb features back all the way till Android 1.6.
Besides these, standard backward compatibility concepts apply.
yes you can do this . Use the min sdk version in your manifest file to API level 2.1.
Add the following line in your AndroidManifest.xml file
<uses-sdk android:minSdkVersion="7" />
this will allow your app to run in any device with api level 2.1 or higher.