Running from Eclipse on devices lower than project's target API version - android

The latest version of AdMob SDK (the only one available to download) requires target=android-14 in the project's properties. This doesn't prevent one from running the app on lower versions of the platform (provided they are compatible with minSdkVersion), but Eclipse "Run" menu filters out all devices (virtual and real) with platform version less then target. Typical scenario
minSdkVersion set to Android 2.1 (API 7)
target set to ICS (API 14), otherwise you won't be able to compile the project because there are errors in the manifest, due to new values for configChanges (see this question)
You can run the app on any device >= Eclair only with the command line, because Eclipse filters out any device < 14. This makes it difficult to test on emulators. I use latest version of ADT (r19) and the Eclipse plugin (18.0)

Does it really filter them out, or is there just a red X next to them? You can still click on those devices to run the app. It's annoying that Eclipse complains about your emulator/device being lower than the target version.
FYI, the SDK requires a minimum of target=android-13 to support the screenSize|smallestScreenSize configChanges.

Related

How to get multiple target android level in eclipse IDE?

While developing an andriod application in Eclipse IDE, the target level is set to 4.4 and I am not getting any option of lower levels of andriod. If I start building the add on higher version.. will my app is executable in lower version devices ?
check your SDK manager, do you have other API version
your app will executable in your minimum SDK setting in your app
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

Android -- selecting API from SDK Manager

I have downloaded the Android SDK(which i think has no version, it is standard). After installing Android SDK, Android SDK Manager comes which by default selects 3 things to be downloaded (1)Android SDK tools(2)Android 4.0.3 (API 15) and the things under it like documentation, samples etc (3)Google USB driver But at present i am having book on Android 3, so should i deselect the second option i.e. Android 4.0.3 (API 15) and select all things under Android 3.0 (API 11) or keeping Android 4.0.3 will be OK for Android 3.I know there are tutorials for Android 4.0.3 on Web so why should i go for Android 3 because i find it easy through books and i got Android 3 here in my place and still no Android 4. So what should i do?
You can install everything. I would recommend to install the API level you want to develop for. But it doesn't hurt (but wastes disk space) to install everything.
Sidenote: Android 3.0 is for tablets, 2.x for older and 4.x for the latest Android Smartphone devices.
You should select the API level that you will target. For example, I am writing an application for API level 7 (Android 2.1.x), so I've got that version installed on my machine. Of course, you can have more than one API level installed, so it is safe to install any combination (for example 3.0.x and 4.0.4 simultaneously - see last paragraph for the reason).
Once you've got a few API levels installed, Eclipse will allow you to change the target API for your project to any of the versions you have installed. The same applies for the command-line project creation.
There is actually one good use-case for installing a version newer than the one you are targeting in addition to the one you use: testing. You can create an emulation environment for a newer version of the API to ensure that your application does not crash and burn when the API levels do not match. If we were to extend my above example, a sensible set of levels to install is 3.0.x, 3.2, and 4.0.4. You can target the initial release of Honeycomb (unless you need anything from the later versions), and test with both the latest Honeycomb and Ice Cream Sandwitch.

Android Build Targets

I have experience in java and I was thinking in starting developing for Android now. Trouble is I have an Android Phone with 2.1-update1 and an Eee Pad Transfomer with 3.1 and I would like to build applications that could work on both devices.
When creating a project in eclipse, I need to choose the Build target, but I can only choose one, so do I choose one that is compatible with both devices or I need to separate projects for different build targets?
If you set up Eclipse to compile with Android 2.1, then it will run on 3.1 too. Most Android API's are backward compatible.
<uses-sdk android:targetSdkVersion="7" android:minSdkVersion="3"/>
In Manifest file, set the "uses-sdk" version to API number matching your Version 2.1 (it's 7, Honeycomb 3.1 is 12)
Set minSdkVersin to whatever you desire (API level 3 is OLD Android 1.5)
Do not set maximum if you want to support future updates of Honeycomb, ignore Warning related to this at build time.
http://developer.android.com/guide/appendix/api-levels.html
Just Use the lower version as target.

Android Device Chooser doesn't list emulators with older APIs than the build version

My application is built on 2.2, but it is backwards compatible down to 1.6. I've used reflection for the newer methods.
When I try to run it on an emulator in Eclipse, it only lists my 2.2 AVDs. I need to test on 1.6 to ensure compatibility.
I've tried building with Android 2.2 and with Google APIs 2.2 with no luck. (what's the difference, anyway?)
I have set <uses-sdk android:minSdkVersion="4" targetSDK="8"/> in my manifest. I also tried targetSDK="4".
Thanks.
Open AVD manager, start 1.6 emulator. Run project in eclipse - started 1.6 emulator will be in the list.
You can't build to a 1.6 emulator when your app is built on 2.2. You can however, do the opposite. Build your project on 1.6 and as long as you set android:minSdkVersion you can build to all emulators higher than that version.
Right click on your project in the Package Explorer.
Select Properties.
Select Android.
Under Project Build target select API 4 (1.6).
Hit OK.
Now when you build your project it can build on a 1.6 emulator assuming you have one setup.

Android app compability

I've build my app under the version 1.6, 2.1 and 2.2 of android and it works. I'd like to know when I'll publish it what is the best :
Build under 1.6 and so it will be compatible with newer version of android
or
Build under 2.2 and set "Target SDK version" to 8 and "Min SDK Version" to 4
Thanks
If you're not using anything that is specific to 2.1 or 2.2 there is no difference. If you for example use install to SD card feature of 2.2 you have to use Target SDK and min SDK option.
Build it under 2.2 and use Min SDK Version.
Target Version is described as the following:
"With this attribute set, the application says that it is able to run on older versions (down to minSdkVersion), but was explicitly tested to work with the version specified here."
Actual statistics of the "market share" are available on the developer website:
http://developer.android.com/resources/dashboard/platform-versions.html
1.6 takes 20% at the moment.

Categories

Resources