Saving a files on Android

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

Re: Saving a files on Android

Post by Pierre55 » Wed Apr 10, 2019 10:50 pm

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: 3022
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Saving a files on Android

Post by airsoftsoftwair » Thu Apr 11, 2019 8:40 pm

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: 44
Joined: Sat Apr 01, 2017 4:25 pm

Re: Saving a files on Android

Post by Pierre55 » Tue Apr 16, 2019 2:24 am

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: 3022
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Saving a files on Android

Post by airsoftsoftwair » Tue Apr 30, 2019 8:42 pm

I don't think Android provides such a capability. Or do you know any apps which provide such a file requester?

Pierre55
Posts: 44
Joined: Sat Apr 01, 2017 4:25 pm

Re: Saving a files on Android

Post by Pierre55 » Wed May 08, 2019 2:03 pm

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

Thank you.

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

Re: Saving a files on Android

Post by airsoftsoftwair » Wed May 08, 2019 10:15 pm

It's just a single line:

Code: Select all

DebugPrint(FileRequest("Select file"))

amyren
Posts: 47
Joined: Thu May 02, 2019 11:53 am

Re: Saving a files on Android

Post by amyren » Sun Jun 23, 2019 11:42 pm

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: 3022
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Saving a files on Android

Post by airsoftsoftwair » Mon Jun 24, 2019 5:02 pm

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