How to save XML file to SD Card
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
How to save XML file to SD Card
Hello
I found many informations on the internet about this problem but nothing works.
Maybe someone can help me.
My app is creating a XML file and I can save it on my Android Tablet to the internal storage with this code.
put textencode(tXMLFinal,"UTF8") into URL ("file:/mnt/sdcard/documents/Test.xml")
I am confused about this, because I use sdcard and the file is not on the sd card. It is on the internal storage.
I tryed different code with sdcard2, external and so on, but nothing!
How can I solve this problem.
The app is on Android 4.1, the Tablet is Android 7
But I think this should not be the problem.
Thanks Texter
I found many informations on the internet about this problem but nothing works.
Maybe someone can help me.
My app is creating a XML file and I can save it on my Android Tablet to the internal storage with this code.
put textencode(tXMLFinal,"UTF8") into URL ("file:/mnt/sdcard/documents/Test.xml")
I am confused about this, because I use sdcard and the file is not on the sd card. It is on the internal storage.
I tryed different code with sdcard2, external and so on, but nothing!
How can I solve this problem.
The app is on Android 4.1, the Tablet is Android 7
But I think this should not be the problem.
Thanks Texter
Re: How to save XML file to SD Card
Hi texter,
try -> specialfolderpath("external documents")
From the dicitonary about specialfolderpaths on ANDROID:
...
"external documents": The folder on the primary shared/external storage device where application-specific data can be placed
...
Note: If using any external folderIdentifier values, ensure you have the 'Write External Storage' permission checked in the application standalone settings
...
Hope that helps.
Best
Klaus
try -> specialfolderpath("external documents")
Code: Select all
put textencode(tXMLFinal,"UTF8") into URL ("file:" & specialfolderpath("external documents") & "/test.xml")
...
"external documents": The folder on the primary shared/external storage device where application-specific data can be placed
...
Note: If using any external folderIdentifier values, ensure you have the 'Write External Storage' permission checked in the application standalone settings
...
Hope that helps.
Best
Klaus
Re: How to save XML file to SD Card
Thank you Klaus
I will try it tomorrow
I will try it tomorrow
Re: How to save XML file to SD Card
Hi Klaus
I tried the code with external documents but the file was saved in
/storage/emulated/0/Android/data/com.yourcompany.yourapp/files
in the internal storage of the Tablet
Dont know whats the problem
Texter
I tried the code with external documents but the file was saved in
/storage/emulated/0/Android/data/com.yourcompany.yourapp/files
in the internal storage of the Tablet
Dont know whats the problem
Texter
Re: How to save XML file to SD Card
Hi texter,
I do not own any mobile device (no cellphone, yep, that's me ), so I can only be of theoretical help.
Did you check "Write external storage" in the standalone builder settings for Android?
Best
Klaus
I do not own any mobile device (no cellphone, yep, that's me ), so I can only be of theoretical help.
Did you check "Write external storage" in the standalone builder settings for Android?
Best
Klaus
Re: How to save XML file to SD Card
hello Klaus
Setting for write external storage is checked.
But until now I could only save to internal storage.
I have no idea how to change this.
Thanks Klaus
Texter
Setting for write external storage is checked.
But until now I could only save to internal storage.
I have no idea how to change this.
Thanks Klaus
Texter
-
- VIP Livecode Opensource Backer
- Posts: 7233
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: How to save XML file to SD Card
Try setting the Install Location to "Prefer external storage". If that doesn't work you'll need to figure out the path to the SD card. Unfortunately that will vary depending on the device or the manufacturer.
External SDCard file path for Android:
https://www.google.com/url?sa=t&rct=j&q ... 6axni_r5Ki
External SDCard file path for Android:
https://www.google.com/url?sa=t&rct=j&q ... 6axni_r5Ki
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com