mrceski 0 Posted March 9, 2021 (edited) I want to read files from documents folder on android in Delphi XE 10.4.2. Some code work very well in Delphi XE 10.3.3 on Android 10. Now show message Cannot open file "/storage/emulated/0/documents/Readme.txt". Permission denied. Code: WS:=JStringToString(TJManifest_permission.JavaClass.WRITE_EXTERNAL_STORAGE); PPS:=jstringtostring(TJManifest_permission.JavaClass.READ_PHONE_STATE); RS:=jstringtostring(TJManifest_permission.JavaClass.READ_EXTERNAL_STORAGE); PermissionsService.RequestPermissions([PPS,WS,RS],nil,nil); Open file in memo. Memo2.Lines.LoadFromFile(TPath.GetSharedDocumentsPath + PathDelim + 'Readme.txt' ,TEncoding.GetEncoding(1251)); Edited March 9, 2021 by mrceski Share this post Link to post
Remy Lebeau 1396 Posted March 9, 2021 (edited) 1 hour ago, mrceski said: I want to read files from documents folder on android in Delphi XE 10.4.2. Why do people keep insisting on using the XE name for things that are not XE?!? Embarcadero stopped using the XE prefix after XE8. The current version is "10.4.2 Sydney", period. Quote Some code work very well in Delphi XE 10.3.3 on Android 10. Now show message Cannot open file "/storage/emulated/0/documents/Readme.txt". Permission denied. Did you read the Android 11 developer documentation? https://developer.android.com/about/versions/11 Google made behavioral changes: https://developer.android.com/about/versions/11/behavior-changes-all In particular: https://developer.android.com/about/versions/11/privacy/storage Edited March 9, 2021 by Remy Lebeau Share this post Link to post