Scoped storage methods for Android 10+

Please post anything related to the Hollywood APK Compiler here
amyren
Posts: 416
Joined: Thu May 02, 2019 11:53 am

Re: Scoped storage methods for Android 10+

Post by amyren »

It got stored without asking for permission?
Or did you grant the app permision already, perhaps in an earlier version of the app with same package name?
xabierpayet
Posts: 281
Joined: Fri Feb 24, 2012 9:34 am

Re: Scoped storage methods for Android 10+

Post by xabierpayet »

yes, checking the permissions in the app, it´s enabled.
User avatar
airsoftsoftwair
Posts: 5856
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Scoped storage methods for Android 10+

Post by airsoftsoftwair »

Next version of Hollywood will feature lots of improvements here...

Code: Select all

- New [Android]: FileRequest() and PathRequest() support Android's Storage Access Framework (SAF) now;
  this means that they will now use the system file pickers to prompt the user to select one or multiple
  files, a path or an output file; furthermore, they will also ask the user for permission if the app
  may access the files in the selected path; note that because those functions now use SAF they will
  return special content URIs now that are different from normal file or path specifications; however,
  since Hollywood's DOS library now has full support for SAF URIs that shouldn't be a problem if you keep
  a few things in mind; if you want the old requesters which returned real file paths back, you can do
  so by setting the new "LegacyRequesters" tag to TRUE in the LegacyControl() command but keep in mind that
  the old requesters will only work correctly if your app has full access to the external storage, i.e.
  if #PERMREQ_MANAGEEXTERNAL has been granted to your app (see below); a great advantage of SAF support is
  that FileRequest() and PathRequest() also allow you to pick files and folders in the cloud, e.g. on
  Google Drive etc. so it's also possible to conveniently deal with files stored in the cloud
- New [Android]: Added support for MediaStore; this is similar to the Storage Access Framework (see below)
  except that there are some restrictions concerning directory management with MediaStore; it's not
  possible to create directories in the MediaStore and it's also not possible to iterate over all files in
  a MediaStore directory; all other features of SAF are also available in Hollywood's MediaStore backend 
- New [Android]: Added support for the Storage Access Framework (SAF); all Hollywood commands dealing with
  files and directories now also support special files/directories managed by the SAF; this opens up lots
  of new possibilities because SAF can do quite some magic since it doesn't only allow you to read/write
  files on your device but also directly in the cloud like on Google Drive; so Hollywood's support of SAF
  makes all this accessible to Hollywood scripts now without having to write new code; nevertheless, there
  are a few important things to be kept in mind; firstly, SAF path specifications aren't like traditional
  paths which is why you can't parse them using functions like FilePart() and PathPart(); moreover, when
  writing a new file using SAF you can't just call OpenFile() but you have to call CreateFile() first to
  actually create the file; after that you can write data to the file; the same is true for directories:
  you cannot create them using MakeDirectory() but you must use the new CreateDirectory() function first
  (see above); otherwise SAF files and directories will behave pretty much the same as normal files; NB:
  SetFileAttributes() isn't supported for SAF files because for security reasons SAF doesn't support
  changing file dates programmatically; also, MoveFile() isn't supported and CopyFile() and DeleteFile()
  can only be used on single files; to delete a SAF directory using DeleteFile(), you first have to make
  sure it's empty
  
xabierpayet
Posts: 281
Joined: Fri Feb 24, 2012 9:34 am

Re: Scoped storage methods for Android 10+

Post by xabierpayet »

Nice to see a new update in the horizon, the color requester should be interesting to be updated, you can't pick any color like black or dark blue and it limits a lot of applications that would use it, the option to be able to add another type of keyboard other than #all and #numerical with only numbers, where we can add characters like +-/* , . would also be interesting
Post Reply