Android Q vs Android R: What's New?
Android Q and Android R are the latest versions of the Android operating system. Each new version brings new features, improvements, and changes to the platform. In this article, we will explore some of the key differences between Android Q and Android R.
Dark Mode
One of the most noticeable changes in Android Q was the introduction of a system-wide dark mode. This feature allows users to switch their device's interface to a dark theme, which can be easier on the eyes and conserve battery life on devices with OLED screens.
<resources>
<style name="AppTheme" parent="Theme.AppCompat.DayNight">
<item name="android:forceDarkAllowed">true</item>
</style>
</resources>
In Android R, dark mode is further improved with additional customization options and better support for third-party apps to adapt to the dark theme.
Privacy and Permissions
Android Q introduced new privacy features, such as restricting access to sensitive device information like location data and call logs. Users now have more control over which apps can access their personal data.
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
MY_PERMISSIONS_REQUEST_LOCATION);
}
Android R builds upon these privacy enhancements by giving users more granular control over app permissions and providing clearer explanations of why an app needs a certain permission.
Scoped Storage
Android Q introduced scoped storage, which restricts apps' access to shared storage and encourages them to use their own designated directories. This improves security and privacy by preventing apps from accessing data they don't need.
<application android:requestLegacyExternalStorage="true" ...>
In Android R, scoped storage is further refined, with additional changes to how apps can interact with external storage and new APIs to help developers migrate their apps to the new model.
New APIs and Features
Android Q and R both introduce new APIs and features to enhance the user experience and provide developers with more tools to create innovative apps. Some of the notable additions include:
- BiometricPrompt API: Standardized way to authenticate users using biometrics like fingerprint or face recognition.
BiometricPrompt biometricPrompt = new BiometricPrompt.Builder(context)
.setTitle("Title")
.setDescription("Description")
.setNegativeButton("Cancel", executor, listener)
.build();
-
Gesture Navigation: Android Q introduced a new gesture-based navigation system, and Android R further refines this feature with improved gestures and animations.
-
Scoped Storage API: Android R introduces new APIs to help developers work with scoped storage and ensure their apps comply with the new storage restrictions.
Conclusion
In conclusion, Android Q and Android R bring a range of new features, improvements, and changes to the Android platform. From enhanced privacy controls to system-wide dark mode, developers and users alike can benefit from these updates. By staying up to date with the latest Android versions and leveraging the new APIs and features, developers can create better apps that provide a seamless user experience on the latest devices running Android Q and Android R.