[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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top