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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login