Save Data, Android Platforms - Help

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By BAsoftware
:warning: Old Version Published before Godot 3 was released.

Hi, i working for mobile platforms.
This file location and File.WRITE working on Windows.

var file_location = "res://save_game.txt"
file.open_encrypted_with_pass(file_location, File.WRITE, OS.get_unique_ID())

But i need help, we how writing game data, Level manager, with godot engine for android platforms.

Thanks.

Doesn’t it work the same way on Android? “res” is independent on platform, isn’t it?

lukas | 2016-03-01 12:15

:bust_in_silhouette: Reply From: Hinsbart

Try user:// instead, it is guaranteed to be writable.
res:// points to the directory where the game is installed, so in many cases (android, program files on windows without admin rights, etc…) it is not accessible.

Edit: see the Data paths tutorial

user://data.bin = in mobile phone /data/data/org.godotengine.myprojename/files/data.bin

Thanks :slight_smile:

BAsoftware | 2016-03-01 13:08