Saving a files on Android

Please post anything related to the Hollywood APK Compiler here
Pierre55
Posts: 54
Joined: Sat Apr 01, 2017 4:25 pm

Re: Saving a files on Android

Post by Pierre55 »

Hi AirSoftSoftwair,

I have a Samsung Galaxy TAB S2 with Android 7.0

Sorry but there is a REQUESTER asking where to save but no interface like in the Amiga, Windows and Mac I suppose in wich we can browse directories to choose where we want to save the file.

Here a link so yuo can see what I have on my screen.

http://pages.infinit.net/pgx/Screenshot ... 164410.png

Thank you.

Pierre.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Saving a files on Android

Post by airsoftsoftwair »

Is this in an applet you run with Hollywood Player or is it in an APK compiled by the Hollywood APK Compiler? If it is in an APK compiled by the APK Compiler, you have to use PermissionRequest() first. Otherwise Hollywood won't be able to read from your external storage, which means that FileRequest() won't show any files and folders to browse through.
Pierre55
Posts: 54
Joined: Sat Apr 01, 2017 4:25 pm

Re: Saving a files on Android

Post by Pierre55 »

Hi,

PermissionRequest() seems only for saving on an external device, I don't have any external device!

I was thinking to get a requester that will give me the choice to save the file in PICTURES, AUDIO, VIDEOS, DOCUMENTS, DOWNLOAD or any other folders available in the INTERNAL STORAGE.

Thank you.

Pierre.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Saving a files on Android

Post by airsoftsoftwair »

I don't think Android provides such a capability. Or do you know any apps which provide such a file requester?
Pierre55
Posts: 54
Joined: Sat Apr 01, 2017 4:25 pm

Re: Saving a files on Android

Post by Pierre55 »

Can you send me the script you use to test the FileRequest() on the Android ?

Thank you.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Saving a files on Android

Post by airsoftsoftwair »

It's just a single line:

Code: Select all

DebugPrint(FileRequest("Select file"))
amyren
Posts: 352
Joined: Thu May 02, 2019 11:53 am

Re: Saving a files on Android

Post by amyren »

My program is made so it will use progdir for saving when I compile for Windows or Amiga.

The same program (apk) running on android does work well for saving or loading, even I did not use PermissionRequest() in my code.
But I have no idea where those savefiles are located on my device.
Where will files be saved if no path is specified?
I did try to search for the files with ES-fileexplorer without luck. Are they perrhaps hidden unless the device is rooted?
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Saving a files on Android

Post by airsoftsoftwair »

amyren wrote: Sun Jun 23, 2019 11:42 pm Where will files be saved if no path is specified?
Internal file storage.
amyren wrote: Sun Jun 23, 2019 11:42 pm I did try to search for the files with ES-fileexplorer without luck. Are they perrhaps hidden unless the device is rooted?
Yup. Quote:
By default, files saved to the internal storage are private to your app, and other apps cannot access them (nor can the user, unless they have root access). This makes internal storage a good place for internal app data that the user doesn't need to directly access. The system provides a private directory on the file system for each app where you can organize any files your app needs.

When the user uninstalls your app, the files saved on the internal storage are removed. Because of this behavior, you should not use internal storage to save anything the user expects to persist independently of your app. For example, if your app allows users to capture photos, the user would expect that they can access those photos even after they uninstall your app. So you should instead use the MediaStore API to save those types of files to the appropriate media collection.
(source)

If you want them to be visible to other apps, use external storage and PermissionRequest().
Post Reply