How can I test my android app on older versions? - android

I have built an android app with targetSDK 15 and minSDK 3. How can I now test it on an older version? When I set the run configurations I only see my "android 4.0" AVD even though I have created AVD for older versions.
Is there any way to test my app?

If you want to test your app for various versions. follow these steps
create all all versions of Android Virtual machines(avd) which you want to test
run your app in all versions of avds which you have created by selecting android target
right click on the project-> properties -> Android -> set target
Enjoy the testing..

Use an Emulator with an older Version.
The android level in project properties is the one which the app is build with. But in Manifest you can specifiy a minSDKVersion - that is the minimal Version for which your App will be available in Play store.
But with adb it is no problem to install it on devices or emulators which are not compatible to your current settings.

Start AVD Manager from Window -> AVD Manager. Run any AVD you like first and then run the app.

Related

In eclipse I a getting the API level 20 .I want ot use lower versions of API

How to change API level. when selecting this API level it shows no CPU/ABi available and also I am not able to add text fields it throws an exception.
Image 1Image 2
In Eclipse go to manifest.xml
<uses-sdk android:minSdkVersion="int" />
In android studio: go to your app Gradle there you can find the minSdkVersion. Lower it to the version you needed.
android {
....
defaultConfig {
....
minSdkVersion 17
....
}
}
Quick Fix: Uncheck installed checkbox to see other downloads and try to refresh android sdk manager, restart it or restart the computer. API 19 worked fine for me before I moved to android studio.
I'm not sure if API 20 is supported in eclipse, I recommend Android Studio for android development. Anyway, if you have an old PC that does not meet android studio minimum requirement, download IntelliJ IDEA https://www.jetbrains.com/idea/, it's a bit lighter and free and require 1 GB of RAM (But 1 GB is very bad, you need at least 2 GB without running android emulator). However, if you still want to work with eclipse I think you need API 19 you have to download it manually from the web and move it to android SDK location. Or you can install android studio to download SDK without using it.
Newer APIs are way better, they have more libraries that supports both old and new android versions. It's really worth upgrading to Android Studio.
For the CPU/ABi error check this post Android 4.3 Virtual Device CPU/ABI - No system images installed (eclipse)

How to get more target platform options for Eclipse AVD?

Using Eclipse, trying to create a new virtual device to test app on older Android versions, but when I go to create a new Android Virtual Device I only get one option - 4.4.2 API Level 19. How do I get other versions to show here? Last night I was a bit tired and tried to if using the SDK Manager to grab 4.0.3 SDK and Google API would work to test on older version, but it seemed to mess up Eclipse as I got an ADT needs update error (which would find no updates). So starting back from scratch and figured I'd ask instead of trial and error. Thanks!
Open the Android SD Manager, check Show: Updates/New
Select SDK Platform and ARM EABI v7a System Image (also Google APIs if you are unsing them) for all Versions you want to test and download them. You need the source of the Android-Version to create an AVD for it.
Updating your Android SDK build-tools and Android SDK Platform-tools is always recommanded because newer Android versions need a newer build tool setup.

Run android app on older API AVD

I want to support newer themes using values-11, values-14, etc. For the application to compile, I have to increase the target API, but that removes the lower API AVDs from the selection list in the run configuration. How do you get eclipse to run it on an older version to see if it works? I'm sure I can load it manually but it seems Eclipse should allow this.
I think Eclipse will try to launch an AVD that satisfies your targetApiLevel, but if any AVD is running at or above your minSdkLevel, then it will use that instead. But you need to make sure the AVD is properly registered with Eclipse. In my experience, this usually would seem to mean not closing the AVD Manager window until the AVD is fully booted and showing the Home screen (or your app).
You can specify which API level to target, but also the minimum that will run the app, in <uses-sdk android:minSdkVersion="X" android:targetSdkVersion="Y" />
The key is to specify the minSdk version too.

Problem with eclipse Android SDK update

I am newbie to android. I working on my HELLO WORLD project. Initially I had AVD which looks like
Then something went wrong so I deleted all Android stuff from Eclipse (except my project) then I added all things again to my Eclipse.
So now I have:
1) Android SDK tools , revison 12
2) Android SDK platform-tools,revision 6
3) SDK platform Android 3.2,API 13,revision 1
Now I got a new emulator which looks like a tablet emulator .
So my questions are
1) How can I get the previous emulator as Image 1 ( which looks like phone not tablet) ?
2) I am also getting error "Unable to resolve target Android-8". Why it is ? and how to get rid of it ?
Answers to your questions:
Ad 1) You need to install SDK platform for Android 1.x/2.x, Android 3.0 is dedicated to tablets so there will be no phone-like emulator,
Ad 2) Android-8 means Android API Level 8, this means Android SDK version 2.2.x. so you will need to install SDK for Android 2.2.x from the Android SDK Manager
More about Android API levels can be found here: http://developer.android.com/guide/appendix/api-levels.html
1.when creating avd you are selecting target.If you select target 2.1,2.2..You will see the first emulator and for the later one your are selecting taget 3.2 . So it looks like this.
2.You are importing/creating project from previous one whose target was api level 8.Now you are trying to run it in avd which is some other.So in manifest file set minSDK as your new avd
With the SDK manager, you have to create a new virtual device. For this virtual device you will set the Android version of your device (must be < 3 to have the "old" look).
It is simple
1) Create AVD
2) While creating if u want to develop for smart phone, select the target version <= 2.3 (Which will get you the keyboard)
3) While creating if u want to develop for tablet, select the target version as >= 3.0, which will get you the big pad emulator with no keypad.
Note: From Icecream sandwidch onwards the version is for both Smart phones and Tablets.
Regards,
SSuman185
You need to create new AVD with the target that you need,or edit the settings of the AVD that you are using now.
In Eclipse go to menu : Window -> Android SDK and AVD Manager and you will see a list of your AVD(if you have more than one).And after that you can select the one that you have,and press edit with changing the target to 1.5 and upper version or create a new one pressing button New.

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.

Categories

Resources