write file and read, works on emulator.
-
Hello,
I try to create a file, i works on Emulator but not on real device (Ubuntu touch)
Code:
function openFile(fileUrl) { var request = new XMLHttpRequest(); request.open("GET", fileUrl, false); request.send(null); return request.responseText; } function saveFile(fileUrl, text) { var request = new XMLHttpRequest(); request.open("PUT", fileUrl, false); request.send(text); return request.status; }
Do i need some permission to allow write to file?
-
What kind of error do you have ?
-
@lduboeuf How can i see the error?
I can't see the error
-
@007fred50 if you use clickable to dzploy your app, just do
clickable logs
.
But you can't write files everywhere, only in your app namespace, that is in /home/phablet/local/share/yourappnamespaceYou can find app logs in .cache/upstart/
-
@lduboeuf There are not (local), but i found (.local)
cd /home/phablet/.local/share/ (no namespace)
All what i want is save variable to next login to the app..
i found this here (Storage) can i use that? instead of write a file
-
@007fred50 yes i think storage is better