Can anybody me help to do Reads and Writes on an Android device with AppStudio (a sample file ?) I tried to do this with the code in Documentation - Apache Cordova. But it doesn’t work.
“Doesn’t work”: Can you give more information? Are there any messages on the Chrome Remote Debugger?
Now I tried your sample “ReadAsText” (Features-Saving data). It works with Chrome on PC, but the built .apk is not installed: “package invalid”.
“Package invalid” is probably a different issue. There’s something that makes Android think it’s not a validly packaged app - at this point, it hasn’t looked at your code.
Have a look at the build log for clues.
Have you made apks successfully already?
For my main app the apk’s will be built successfully. I will check the build log.
Can I use SQL Export and SQL Import to create backups? Where is the Json object saved?
SQImport and SQLExport translate a string to and from an SQLite database. They do not write data out.
For very good reasons, browsers are restricted from writing directly to the file system of the computer they are running on.
If you are running on a native device, you can use Cordova plugin to write and read strings from disk.
I understood that this Cordova plugin is depreciated.
The problem with the readAsText sample is solved: I can only have 1 apk file on android otherwise the installer will update the second one. How can I install 2 independent apps ?
In this sample a file manager is displayed to select a file to read, that is successful, but I want to read the file directly. But if I specify a filename as first parameter of reader.readAsText I get an error message: ‘the 1. parameter is not of type blob’
Which Cordova plugin? Would this one work for you?
cordova-plugin-file
They need to have different Title properties in Project Properties.
That’s correct. You’ll want to read up on ReadAsText():
Okay, thanks for the Title hint. I have tested the Cordova plugin you mentioned with Remote Debugger. I successfully get to the DataRead (onloadend) routine, file size, modification date are OK, but I get no output in this.result.
Even though the title is different for 2 apps (.apk), Android wants to update the app and not install it as new. Is there anything that needs to be changed in the Volbuilder section?
Another question: is Tutorial 06: ‘Reading and Writing Data’ from September 20, 2009 still a candidate for writing and reading files in native apps? Is it worth trying?
We don’t provide support for third party plugins.
This one is widely used, with close to 50,000 downloads within the last week. I suspect a problem is in your code or how you’re using the plugin.
Check for errors on the Remote Console.
In Project Properties, VoltBuilder, what is the ID line in config.xml?
A lot has changed since 2009. Read and writing data works quite differently as browsers have addressed the security issues of web pages being able to modify files on the user’s system.
Where did you find this tutorial?
in config.xml: id = “com.nsbasic.{id}”
in config.xml: id = “com.nsbasic.{id}”
That’s for NS Basic/CE. We discontinued that more than a decode ago.
It was for Windows CE devices.
Any change you kept the logs from the build? I’d like to see what values were substituted for {id}
.