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

  • Thread starter Thread starter Darkmisc
  • Start date Start date
  • Tags Tags
    Android godot
Click For Summary
SUMMARY

The discussion centers on accessing files saved in the user:// directory of a Godot application on Android devices. Users discovered that files saved in this directory are sandboxed and not directly accessible through standard file browsing methods on Android. The use of ProjectSettings.globalize_path("user://") reveals the file path, but files remain invisible outside the app due to Android's security model. To share files externally, developers must implement sharing intents as outlined in the Android documentation.

PREREQUISITES
  • Familiarity with Godot Engine and its file management system
  • Understanding of Android app sandboxing principles
  • Knowledge of Android sharing intents and their implementation
  • Basic experience with file paths in mobile development
NEXT STEPS
  • Research how to implement Android sharing intents in Godot applications
  • Explore the Godot documentation on file management and user:// usage
  • Learn about Android's sandboxing model and its implications for app data access
  • Investigate alternative storage solutions for files that need to be accessed externally
USEFUL FOR

Game developers using Godot Engine, mobile app developers looking to manage file access on Android, and anyone needing to implement file sharing features in their applications.

Darkmisc
Messages
222
Reaction score
31
TL;DR
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
 
  • Like
Likes   Reactions: Darkmisc
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.
 
  • Like
Likes   Reactions: Darkmisc

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 22 ·
Replies
22
Views
2K
Replies
10
Views
6K
  • · Replies 9 ·
Replies
9
Views
1K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
81
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K