1

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?

Manish Kumar Sharma
  • 12,982
  • 9
  • 58
  • 105

2 Answers2

3

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.

Ed Holloway-George
  • 5,092
  • 2
  • 37
  • 66
shkschneider
  • 17,833
  • 13
  • 59
  • 112
0

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.

  • I just checked in gradle script, minSDKVersion=15(ICS). So, should I conclude that if my base class is ActionBarActivity, it is according to ICS and if I were to change the minSDKVersion to JellyBean, would it be Activity? – Manish Kumar Sharma Jun 18 '15 at 15:49
  • From http://stackoverflow.com/questions/23516578/by-default-android-creating-new-project-as-actionbaractivity : " 1. Downgrade your SDK to 4.3 or lower. or 2. Remove ActionBarActivity and extends Activity in your java file. " – Roel Strolenberg Jun 18 '15 at 15:56