0 votes

GODOT HOW TO READ AND WRITE FILES IN ANDROID PLATFORM WITH FILE SYSTEM
I AM WORKING WITH FILE DIALOG

BELOW MY CODE FOR READ AND WRITE FILE
func onsave_pressed():
$FileDialogsave.popup()

func onopen_pressed():
$FileDialog.popup()

below save function

func onFileDialogfileselected(path):
var file = File.new()
file.open(path, File.READ)
var texty = file.getastext()
$TextEdit.text = texty
file.close()

func onFileDialogsavefileselected(path):
var text = $TextEdit.text
var file = File.new()
file.open(path, File.WRITE)
file.store_string(text)
file.close()

Godot version 3.3.4
in Engine by (36 points)

Does recording work on pc?

yes it works on pc
you can check it on pc it works fine but on android it don't work

var savepath = "C:/Users/xxx/Desktop/Game/save.dat" = for pc
var save
path = "user://data.dat" = for android

"Note = I couldn't see the part you wrote in the folder"

you can see video if you were unable to see save path

link of video below

video_link

sory . where is save script?
Are these in your save script?

var savepath = "C:/Users/xxx/Desktop/Game/save.dat" = for pc
var savepath = "user://data.dat" = for android

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.