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

  • Thread starter Thread starter Darkmisc
  • Start date Start date
  • Tags Tags
    Android godot
AI Thread Summary
The discussion centers on the challenge of accessing files saved in the user directory of a mobile app developed with Godot. The user successfully locates the file path using ProjectSettings.globalize_path("user://") but finds the directory empty when checked on their phone. It is noted that mobile operating systems like iOS and Android use sandboxing, restricting access to app-specific files from outside the app. While the files can be managed within the app and accessed on a PC, they remain inaccessible directly through the phone's file system. To share or transfer these files between devices, the implementation of sharing intents is recommended, allowing files to be saved in a more accessible location on the device.
Darkmisc
Messages
222
Reaction score
31
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
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
 
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.
 
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.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top