How to download sdk from android 4.2 to android 2.3

9

I have an application almost finished but when I created it I put the minSdk with value 14, which I need to put at least Android 2.3 Greetings.

    
asked by Pablo Miró 07.06.2016 в 21:24
source

3 answers

2

You go to build.gradle in defaultConfig and you place the minSdkVersion that is 10:

Example:

defaultConfig {
        applicationId "mx.xxx.aplicacion"
        minSdkVersion 10
        ...
    }

Then click on the Sync button :

    
answered by 07.06.2016 в 21:45
2

There are two ways, the first is directly in your AndroidManifest.xml where you define the property:

android: minSdkVersion

in which you define the minimum API in which your application will be supported. The API version for Android 2.3 is 9 , so So much this would be the value:

android: minSdkVersion = 9

The second option is to define the SDK version within your file build.gradle with the minSdkVersion property:

android {
    ...
    ...    
    defaultConfig {
        ...
        minSdkVersion 9
        ...
        ...
    }

On the documentation you can see the constant to define the API constant for OS Android 2.3 and others.

    
answered by 07.06.2016 в 22:07
1

To the response of @ElenaSys a series of points should be added to be taken into account when making the change, since in Android 2.3 there were not many APIs that are currently used as a base.

The recommendation is to use the Support Library (especially AppCompat ) to take advantage of several of the improvements that have been introduced in later versions of Android .

I think the most common ones are:

  • Fragments
  • ActionBar
  • NotificationCompat
  • Loaders

Instead of

class ActivityMain extends Activity {
...
} 

You should use

class ActivityMain extends AppCompatActivity {
...
} 

AppCompatActivity

In case you have a theme defined, instead of

<style name="AppTheme" parent="android:Theme.Light">
...
</style>

You should start using

<style name="AppTheme" parent="Theme.AppCompat.Light">
...
</style>

I gave as an example Theme.AppCompat.Light, but there are other alternatives

This is just a basis for you to get an idea. I leave you two links (in English) so you can get more information.

answered by 09.06.2016 в 05:22