Terry Gilliver wrote: ↑Tue Jun 06, 2017 10:46 am
how does android min sdk and target sdk affect the app? I want it to be available to as many versions as possible.
The minSdkVersion and targetSdkVersion in Android's build.gradle file affect app compatibility and behavior:
Code: Select all
minSdkVersion: Specifies the minimum Android version your app supports. Lowering it expands compatibility but restricts access to newer features.
targetSdkVersion: Sets the highest API level your app is tested against. Newer devices use compatibility behavior closer to this version.
To make your app available to as many versions as possible:
Code: Select all
minSdkVersion: Keep this value relatively low, but consider the trade-off between compatibility and access to newer features.
targetSdkVersion: Set it to the highest tested API level. Regularly update to the latest stable version.
Testing and Optimization: Extensively test on various Android versions to ensure compatibility. Optimize for both newer and older devices.
Feature Checks: Use runtime checks for specific features introduced in higher versions, so the app gracefully handles compatibility issues.
Support Libraries: Utilize AndroidX libraries and backward-compatible features to ease compatibility concerns.
Google Play Services: If needed, use version-specific dependencies to access Google Play Services functionality across different versions.