Saving a files on Android
Saving a files on Android
Hi,
I succeed to upload my application to my Android device (Galaxy Tab S2) but now I have another problem with the SAVING section of my script, when I want to save I don't have any way to choose the destination and the one the script propose is not working (/storage/emulated/0!), it give me an error "Error Locking /storage... in function FileRequest"
Thank you.
I succeed to upload my application to my Android device (Galaxy Tab S2) but now I have another problem with the SAVING section of my script, when I want to save I don't have any way to choose the destination and the one the script propose is not working (/storage/emulated/0!), it give me an error "Error Locking /storage... in function FileRequest"
Thank you.
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Saving a files on Android
On Android you may only write to certain folders. You can get those paths using GetSystemInfo(). You can choose to write to "InternalStorage", "ExternalStorage", or "SDCard", e.g.
Code: Select all
StringToFile("Hello World", FullPath(GetSystemInfo().InternalStorage, "test.txt"))
Re: Saving a files on Android
Thank you,
I need more info about this command..
I try;
t = GetSystemInfo()
DebugPrint(t)
and I have this;
Table: 0x5a676ca8
It seems that this command can work only on Windows, MacOS, Linux, and for some fields Android?
I'm using AmigaOne XE.
Thank you.
I need more info about this command..
I try;
t = GetSystemInfo()
DebugPrint(t)
and I have this;
Table: 0x5a676ca8
It seems that this command can work only on Windows, MacOS, Linux, and for some fields Android?
I'm using AmigaOne XE.
Thank you.
Re: Saving a files on Android
You need to specify the Table field that you want (such as: t.InternalStorage).
The following should work on your Amiga:
The following should work on your Amiga:
Code: Select all
t = GetSystemInfo()
DebugPrint(t.Preferences)
DebugPrint(t.TempFiles)
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Saving a files on Android
Also note that if you want to write to the path returned in "SDCard" (see above), you need to ask for permission first by using PermissionRequest().
Re: Saving a files on Android
I run your script on a virtual Android (Bluestack)
StringToFile("Hello World", FullPath(GetSystemInfo().InternalStorage, "test.txt"))
But there is no requester asking where I want to save the text file!
Thank you.
StringToFile("Hello World", FullPath(GetSystemInfo().InternalStorage, "test.txt"))
But there is no requester asking where I want to save the text file!
Thank you.
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Saving a files on Android
If you want a requester, you need to use FileRequest() to obtain a path.
Re: Saving a files on Android
Well even using FileRequest() on android does nothing... there is no requester!
Anyone can validate that please.
Thank you.
Pierre
Anyone can validate that please.
Thank you.
Pierre
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: Saving a files on Android
Works here. Which Android version are you on?