Privacy Android 10 has a focus on improving users’ privacy, which means apps must adapt to new restrictions ● Scoped Storage ● Foreground-only location ● Background execution limits ● Access to unique ids like IMEI ● Wifi/BT scanning
Scoped Storage ● Android 10 doesn’t allow apps to access entire SD Card ○ Used “scopes” like PICTURES, MUSIC, MOVIES etc ○ Apps can only see files within a scope ● File Managers, as we know them, might cease to exist ● Legacy support, for the time being ○ requestLegacyExternalStorage in Android Manifest
Background location ● New permission ACCESS_BACKGROUND_LOCATION ● For older apps, OS automatically adds permission if FINE/COARSE location requested. ● Must be explicitly added for targetSdk = 29 ● Without this permission, location works only in activities and foreground services
Restrictions on background start ● Old way ○ Send intent with FLAG_ACTIVITY_NEW_TASK from service to start activity. ● New Way ○ Display time sensitive notifications with pending intent to activity ○ User can swipe away notification, or click it – which opens activity. ○ Even time-sensitive notifications are subject to DND rules. ● Exceptions ○ If app already is in foreground, or has a recent task open. ○ App is device policy manager.
Clipboard Data Limitations ● You cannot access clipboard via ClipboardManager ● Only app that is currently default set IME (keyboard) has access to last clips on clipboard. ● Users can only explicitly paste data into your app
Reading IMEI / MAC ● Only apps with READ_PRIVILEGED_PHONE_STATE can read IMEI ● Submitting apps with READ_PRIVILEGED_PHONE_STATE to Play Store not allowed. ● Device Admin apps, and apps with carrier permissions (SIM card apps) can still access ● MAC address is now randomized. Device Admin apps can still read actual MAC address.
Toggling WiFi and reading saved networks ● Your app cannot toggle WiFi ○ WifiManager.setWifiEnabled() returns false always ● To nudge the user to turn on Wifi, send him to Settings app or use a Setttings panel (more on this later). ● Apps cannot read any information about saved networks, nor can they connect/reconnect/disable/forget saved networks.
Physical Activity Recognition ● To read step counter and step detector, new permission needed ○ ACTIVITY_RECOGNITION ● Accessing data indirectly from apps like Google Fit will also need the same permission
Biometric Prompt § A new BiometricManager with BiometricPrompt § Check if device has biometrics § Available via androidx.biometric support library. § Supports face, fingerprint, IRIS and other mechanisms
Audio Input Sharing ● Earlier only one app could read an audio source ● From Android 10, multiple apps can plug into the same audio source. ● Easier to make apps like call-recorder.
Dynamic Depth Format Use depth information in a new open dynamic depth format. Apps can use that information to post process (add/remove bokeh) from the photos.
HEIC support ● High efficiency image file/codec (HEIF/HEIC) support ● All Android 10 devices can record video in HEIC ● All Android 10 devices can seamlessly and transparently read HEIC files.
Settings Panels § A new API to show a popup to users to toggle certain settings. § Android 10 doesn’t allow apps to directly change BT, Wifi etc states. § Apps can nudge a user by showing a settings panel.
Sharing Shortcuts API § Android Direct Share API is really old, and had become very slow if multiple apps installed. § It used to query all sharing intents at runtime and the dialog would take time. § Sharing Shortcuts API makes it much faster.
Android OS improvements § ART performance has improved. § On-Device TensorFlow support is better with Neural Networks API 1.2 § Thermal API for apps to check device heat-up and mitigate it.
Step 1 ● Make sure your current app works on Android 10 ● Get an Android 10 emulator or Android 10 device (Oneplus/Pixel for now) ● Check everything works on your app