Recent

Author Topic: [LAMW] WRITE_EXTERNAL_STORAGE permission on Android 10  (Read 1395 times)

kagamma

  • New Member
  • *
  • Posts: 14
[LAMW] WRITE_EXTERNAL_STORAGE permission on Android 10
« on: June 17, 2023, 04:23:26 pm »
So, I tried to run the AppJCenterOpenStreetMapDemo2 example. It ran fine on the LDPlayer emulator, which runs on Android 9. However, when I attempted to run the same app on my real device - an Asus ROG 3 running on Android 10 - it failed to grant the android.permission.WRITE_EXTERNAL_STORAGE permission, even though I had already pressed 'Accept' when the permission dialog popped up. Any ideas on how to fix this issue?

Insid3Code

  • New Member
  • *
  • Posts: 27
  • Code Immersion
Re: [LAMW] WRITE_EXTERNAL_STORAGE permission on Android 10
« Reply #1 on: June 17, 2023, 07:42:24 pm »
Just update the AndroidManifest.xml with these values...
1- add xmlns:tools="http://schemas.android.com/tools"
2- change from:
Code: Pascal  [Select][+][-]
  1. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28"/>
to
Code: Pascal  [Select][+][-]
  1. <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:remove="android:maxSdkVersion" tools:ignore="ScopedStorage"/>

See animated gif:
https://i.imgur.com/6FerdbA.gif

kagamma

  • New Member
  • *
  • Posts: 14
Re: [LAMW] WRITE_EXTERNAL_STORAGE permission on Android 10
« Reply #2 on: June 18, 2023, 12:13:43 pm »
Thanks, it worked. However considering the recent changes made to the WRITE_EXTERNAL_STORAGE permission, I wonder if OpenStreetMap example will still function properly with higher versions of Android.

 

TinyPortal © 2005-2018