Google has launched the second beta of Android Q.
Android Q |
Google has launched the second beta of Android Q. This version brings multitasking bubbles, foldable emulator, zoomable microphones, and more exciting features. User privacy has been the focus of Android Q so far.
The first beta already brought features like blocking permissions to background apps, clipboard managers are killed and even runtime permissions for older apps are changing. Android Q beta 2 brings major changes to how apps access local files.
The first beta already brought features like blocking permissions to background apps, clipboard managers are killed and even runtime permissions for older apps are changing. Android Q beta 2 brings major changes to how apps access local files.
Scooped Storage
Android creates isolated storage sandboxes for each app using scooped storage. The feature no longer requires apps to access special permission to write their own files. Other apps can directly access the data from another app's sandbox. This makes it safer and easier for apps to access files of other apps on internal and external storage.
There are several permission changes with Scooped Storage as well. READ_MEDIA_AUDIO now grants permission to the Music folder. READ_MEDIA_VIDEO will give access to the videos folder. READ_MEDIA_IMAGES gives access to the Photos folder.
Android Q has changed the naming structure for all external storage devices. Earlier all the external storage devices like flash drives, SD cards were listed under the single external volume.
Best practice that developers should follow for scooped storage:
• Storing shared media files: Developers working on apps that handle files that users share with other apps (like photos), need to use MediaStore API. There are specific collections for common media files. For other file types, you can store these items in new Downloads collection.
• Storing app-internal files: If your app doesn't have files that are to be shared with other apps, you need to store them in your package specific directories. This will keep files organised and limit file clutter. Developers are advised to call Context.getExternalFilesDir()
• Working with permissions: For MediaStore, permissions are not necessary for apps that only access their own files. Your app will need to request permission from the user to access media that your app previously contributed.
• Working with native code or libraries: The recommended pattern is to start media file discovery and pass the file's associated file descriptor in the native code.
• Working with many files: It is recommended to use Content.Provider.applyBatch() if your application needs to perform bulk of file operations in a single transactions.
This version of Android includes 'compatibility mode' that disables these new restrictions. This mode is available only for apps installed before a device updated to Android Q. If the app is built for Android 9 Pie or older.
No comments:
Post a Comment