I need to suppoert api level 10, and working with latest sdk to provide new device features (only if sdk of device is new).
on manifest I choose min version 10.
The problem is that the application is not installed succesfully on the old sdk devices.
Whne I debug on those devices it works, The installation of signed aok fails.
Any suggestions?
Use this in your manifest file
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
If your application uses any API's that are not available on older Android versions, then you should try to use Support Libraries or just give up on those devices. If the application does run on older emulators in debug mode, then you can just change the minSdkVersion in the manifest to a lower one. Hope this helps.
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
if i use android 4.1.2 (API 16) Android SDK will my apps work on Android 2.3 phones. i have downloaded android 4.1.2 sdk tools and other packages.
You will need to set the minimum SDK attribute in your manifest to 2.3 to ensure you app will work on earlier versions of the OS.
Your app will work fine, assuming you are not using any API calls from a later version.
The Android Dev team suggests you always compile against the newest version you can support. So, you are on the right track.
So bottom line, you are on the right track, just make sure to test your app against a 2.3.3 version of the emulator to ensure you are not using any un-supported API calls.
No, if your minimum sdk version is 16 it wont work on that android version.
if you want it to work on that specific version then set the minimum sdk version to 9. You can change this in the apps manifest file.
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="21"
/>
If you are getting errors probably saying "This code uses the minimum sdk to be api 16 or higher"
find alternate ways to modify the code for older android phones. If that does not work then dont support old version of android maybe.
I experience this problem when I added another project from internet. I think it asks me to use another version of target android. But I want that my app will work in android 2.2.
But it doesn't require API-8, it requires API-16 and I m not sure what I should do.
Modify the AndroidManifest.xml file so that any versions in there are Android 2.2. Also change the version of the SDK used by right clicking the project in eclipse and go to properties->android and change the version to 2.2. Some things might break though. Usually the version declared in the manifest is declared because the project uses SDK features only available for that version or later.
Your app will still work on older versions even if you are targeting newer version. The target is what version you have tested your app to work on. If you target the most recent version (API 16), then your app will not be put in 'compatibility mode' when running on older phones. For example, if you have a menu button in 2.x but you target API 16, this menu button will not show up on certain phones since you're supposed to be using the ActionBar.
The minSdkVersion is what you are thinking of, which will make sure your app runs on older versions:
<uses-sdk android:minSdkVersion="8" />
So the solution to your problem is just to download the newest API level through the SDK Manager. You most likely just don't have API 16 installed.
I would like to know if phones with Android 2.3 or lower could download Apps with:
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15"/>
and Build Target 15?
Becuase I have to do so to use the AdMob jar.
Thanks
Yes they can, this is the goal of the android:minSdkVersion attribute. It prevents users with an older android version to download and install the app.
Yes, any device running SDK version 7 and above will be able to install your application. The targetSdkVersion attribute doesn't restrict devices from installing your application. Instead, it specifies the maximum API level on which your application should be able to run on.
Just be careful that you protect earlier versions of Android from making use of the new methods provided in SDK 15, as this will cause your application to crash.
It seems that it isn't possible to create a PhoneGap app for Android 2.x. Is that right?
For running android applications using phonegap build your application as Android 4.0.3 and set the minimum version to the lower version whatever you want. Basically Android 4.0.3 build does not affect the functionalities of the older android version. And this app perfectly works with android lower versions.
I usually do like this in manifest.xml
<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="15"/>
Okay - so answering my own question. You need Android API mark 15 installed for PhoneGap to work.
But . . . you can change the AndroidManifest.xml file in the application to make it backwards compatible.
For example
<uses-sdk android:minSdkVersion="10" />
will be compatible with 2.3.3