[Godot] Can I directly access files saved on Android to user:// ?

  • #1
Darkmisc
204
27
TL;DR Summary
My program saves files to user://. I'd like to find these files on my phone and copy them to another phone. Is it possible?
Hi everyone

My program saves files to user://. I'd like to find these files on my phone and copy them to another phone. Is it possible?

I used
ProjectSettings.globalize_path("user://")

to show where the file saved and got

/data/org.godotengine.[APP_NAME]/files/

However, when I went to the directory, it was empty (I have show hidden files on). When I checked the properties of /files/, it showed 0 bytes and zero files.

I did a file search on my phone under the file name and nothing came up either.


Thanks
 
Technology news on Phys.org
  • #2
Typically with iOS and Android, these folders that the app has access to are sandboxed and only available from within the app. I would be interested if you were able to save the file, and then from in the app, pull up and find the file saved at that location. I'm not very familiar with godotengine, but I know with similar things, you have to enable sharing intents. You can read more about sending and receiving files through intents here:

https://developer.android.com/training/sharing/send
https://developer.android.com/training/sharing/receive
 
  • Like
Likes Darkmisc
  • #3
weller said:
Typically with iOS and Android, these folders that the app has access to are sandboxed and only available from within the app. I would be interested if you were able to save the file, and then from in the app, pull up and find the file saved at that location. I'm not very familiar with godotengine, but I know with similar things, you have to enable sharing intents. You can read more about sending and receiving files through intents here:

https://developer.android.com/training/sharing/send
https://developer.android.com/training/sharing/receive
The files shows up and can be loaded and deleted within the Android app. I can also find it on my PC and open it as a text file when I run the app within Godot.

What I can't do is plug my phone into the PC and find the file on my phone in a directory.
 
  • #4
Yes, I think this is going to be by design since the apps are sandboxed. You'll need to implement something like what I mentioned above and save it off to another place that is globally accessible by the device.
 
  • Like
Likes Darkmisc

Similar threads

  • Programming and Computer Science
Replies
1
Views
544
  • Programming and Computer Science
Replies
4
Views
387
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
Replies
22
Views
921
  • Programming and Computer Science
Replies
9
Views
862
  • Programming and Computer Science
Replies
1
Views
268
  • Programming and Computer Science
3
Replies
81
Views
5K
  • Programming and Computer Science
Replies
10
Views
1K
  • Computing and Technology
Replies
3
Views
2K
  • Programming and Computer Science
Replies
11
Views
1K
Back
Top