Google förbättrar systemets hantering av minneskort i Android 5.0

Postat:
10:35 - 2014-11-05
Skribent:
| Lars A
Kommentarer:
22

Androids hantering av minneskort har varit ett omdiskuterat ämne senaste åren, då appars rättigheter att utnyttja minneskort begränsats i senare versioner av plattformen. Många KitKat-användare har säkert exempelvis sett meddelandet som berättar att en bild lagrad på ett minneskort inte kan raderas.

Google verkar ha löst detta i Android 5.0. Appar kan begära access från användaren till enskilda filer, till mappstrukturer eller till ett helt minneskort. Den appen kan då skapa, uppdatera och radera mappar och filer i strukturen du gett appen tillgång till. Mer information för utvecklare finns här.

We heard loud and clear that developers wanted richer access beyond these directories, so in Lollipop we added the new ACTION_OPEN_DOCUMENT_TREE intent. Apps can launch this intent to pick and return a directory from any supported DocumentProvider, including any of the shared storage supported by the device. Apps can then create, update, and delete files and directories anywhere under the picked tree without any additional user interaction. Just like the other document intents, apps can persist this access across reboots.

This gives apps broad, powerful access to manage files while still involving the user in the initial selection process. Users may choose to give your app access to a narrow directory like “My Vacation Photos,” or they could pick the top-level of an entire SD card; the choice is theirs.