0
0
Android Kotlinmobile~10 mins

App size optimization in Android Kotlin - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable ProGuard for app size optimization in the build.gradle file.

Android Kotlin
android {
    buildTypes {
        release {
            minifyEnabled = [1]
        }
    }
}
Drag options to blanks, or click blank then click option'
A"true"
Bfalse
Ctrue
D"false"
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values like "true" instead of boolean true.
Setting minifyEnabled to false disables code shrinking.
2fill in blank
medium

Complete the code to exclude unused resources during build to reduce app size.

Android Kotlin
android {
    buildTypes {
        release {
            shrinkResources = [1]
        }
    }
}
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
C"false"
D"true"
Attempts:
3 left
💡 Hint
Common Mistakes
Using string values instead of boolean.
Setting shrinkResources to false disables resource shrinking.
3fill in blank
hard

Fix the error in the Kotlin code to load only necessary native libraries to reduce app size.

Android Kotlin
System.loadLibrary([1])
Drag options to blanks, or click blank then click option'
A"native-lib"
Blibnative
C"libnative"
Dnative-lib
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the library name without quotes causes a compile error.
Including the lib prefix or file extension is incorrect.
4fill in blank
hard

Fill both blanks to configure ABI splits to reduce APK size by targeting specific CPU architectures.

Android Kotlin
android {
    splits {
        abi {
            enable = [1]
            reset()
            include [2]
        }
    }
}
Drag options to blanks, or click blank then click option'
Atrue
Bfalse
C["armeabi-v7a", "arm64-v8a"]
D["x86", "mips"]
Attempts:
3 left
💡 Hint
Common Mistakes
Setting enable to false disables ABI splits.
Including uncommon or unsupported ABIs.
5fill in blank
hard

Fill all three blanks to create a ProGuard rule that keeps only the necessary classes and removes unused code.

Android Kotlin
-keep class [1] {
    [2];
}
-dontwarn [3]
Drag options to blanks, or click blank then click option'
Acom.example.app.MainActivity
Bpublic *
Ccom.example.app.**
Dandroid.support.**
Attempts:
3 left
💡 Hint
Common Mistakes
Using wildcard for class name instead of specific class.
Not specifying members to keep.
Ignoring warnings from support libraries.