Android build version and minSDKVersion in Android Studio

1.1k views Asked by At

I have read other answers in context of "What is minSDKVersion and targetSDKVersion?" on SO and those were good enough for understanding but they talked about eclipse, not that it really matters that much.

Anyway, I wanted to ask in context of Android Studio, that when creating new app, it asks for minSDKVersion only but no targetSDKVersion as it used to do in Eclipse. Why is this? Is it insignificant?

The other thing I wanted to ask is, when I did create a new app infact with minSDKVersion as IceCreamSandwich(4.0.3), the class MyActivity extended from ActionBarActivity and not from Activity. Why is this happening?
Are minSDKVersion and targetSDKVersion equal in this case? and if this is the case, Would I get the base class as Activityif I were to change the targetSDKVersion explicitly to say, API 21?

2

There are 2 answers

0
shkschneider On

In Android Studio, everything turns around Gradle.

Your build.gradle file has this in it:

android {
    compileSdkVersion 22
    buildToolsVersion '22.0.1'

    defaultConfig {
        applicationId 'your.package.name'
        minSdkVersion 14
        targetSdkVersion 22 // default is latest
        versionCode 1
        versionName '1.0.0'
    }
}

Here you can see the minSdkVersion and targetSdkVersion.

Nothing is required in the AndroidManifest.xml file anymore, regarding API levels.

2
Roel Strolenberg On

Regarding your Activity issue: ActionBarActivity is a child class of Activity. ActionBarActivity is given automatically provided as it's the newest support tool available w.r.t. the minSDKVersion. If you simply want to use Activity, just change it in the code and remove unused methods.