0

I changed the API level in my android project for test purposes from 22 down to 7 in the build.gradle file.

Gradle has no problems to build the project and it runs on my (Android 5.1 OS) withouth problems.

Does the successfull build indicates the app would run without problems on lower OS (down to API level 7)? If not - how can I check which API is the lowest appropriate for my application?

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.2"

        defaultConfig {
            applicationId "com.myapplication"
            minSdkVersion 7
            targetSdkVersion 23
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.2.0'
        compile 'com.android.support:design:23.2.0'
    }
Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
sampa
  • 535
  • 4
  • 27

1 Answers1

2

The Gradle tooling, especially Lint, is nowadays very good to figure out whether or not your minSdkVersion really works for your app and will usually block a release build in the lintVitalRelease task when you use API that is not available on your min SDK level.

And of course, you always could (and should) create an API level 7 emulator and test-drive your app there as well. Even if it does not crash right away, some things might behave weird / different or might plainly be not working or visible at all, because compat API calls you were using have been converted to noops on lower API levels.

Thomas Keller
  • 5,933
  • 6
  • 48
  • 80