Develop on Android 4.0, is it compatible with 2.3 devices and all tablets?

I have been making iphone apps for a while, but now I want to start making them on Android as well.

However, I see that a new 4.0 appears and wondered if I am not using any features available only in version 4.0, can I use 4.0 sdk for development for all 4.0, 2.3 and tablet devices on at the same time?

So, I can make it compatible for all tablet devices and all applications running 2.3.

Many thanks for your help.

+4
source share
3 answers

If you want to do as you said, this is in your manifest:

<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="15" /> 

This suggests that you support version 2.3.2, but are developing against 4.0.3.

This will work on all phone / tablet devices that work on Android> = 2.3.2.

How to look good on all of these devices is a completely different matter.

EDIT to explain min and target

midSdk says yes, I support the platform version 9 and all above it. Therefore, I can work with the Android system code on any v9 device and higher. In combination with targetSdk, he says that I can work on a minimal v9 platform, but I tell you that I tested upto v15, so if you can do something cool to help my application (e.g. hardware graphics acceleration), do it! because I aimed at this version. But I do not rely on hardware acceleration to work!

+6
source

In your application, you have 3 controls for the sdk version.

 <uses-sdk android:minSdkVersion="integer" android:targetSdkVersion="integer" android:maxSdkVersion="integer" /> 

MinSdkVersion sets the minimum api level at which your application will be allowed to install.

TargetSdkVersion is a version of sdk whose application will actually be created against.

maxSdkVersion is the same as the minimum version of sdk, but in general it should never be used.

Each version of Android must be backward compatible, so often the solution to the problem is aimed at the minimum version of sdk. In your case, you can target to 2.3, and your application will work fine on 4.0. However, if you do this, you will not be able to use any of the 4.0 specific API changes, many of which are tablet specific, and you will not miss.

If you want to take advantage of only 4.0, you can either download two separate applications to the market (most of the code base can be the same), as described in this blog post , or if these are very small sections of the code, you may find the version of the API during execution as described in fooobar.com/questions/1387431 / ....

+2
source

sdk may be compatible with previous versions if you use a compatibility pack or a support pack. http://developer.android.com/sdk/compatibility-library.html

+1
source

Source: https://habr.com/ru/post/1387430/


All Articles