cordova-nativestorage

How get data from cordova-plugin-nativestorage in android java

杀马特。学长 韩版系。学妹 提交于 2020-01-11 08:52:07
问题 Good day, I making native background mod for Cordova and I need get data from js to java. I save data in js with plugin cordova-plugin-nativestorage, with this code: <!DOCTYPE html> <html> <head> <title>Save data</title> <script type="text/javascript" charset="utf-8" src="cordova.js"></script> <script type="text/javascript" charset="utf-8"> function onLoad() { document.addEventListener("deviceready", onDeviceReady, false); } function onDeviceReady() { NativeStorage.setItem("somekey", "value",

Why does cordova-plugin-nativestorage work on browser but not on phone

£可爱£侵袭症+ 提交于 2019-12-08 13:30:50
I am using the Phonegap CLI to serve my project and my plugin version is: 2.3.1 So, I wrote the following code to execute after the device is ready: NativeStorage.getItem("abcd",function(){ console.log("success");alert("success"); },function(){ console.log("fail");alert("failed :)"); }); This works perfectly when I am testing it on my browser. However, when I open this app on my android phone, the NativeStorage code does not work at all. I used weinre to debug my app: I got the error: ReferenceError: NativeStorage is not defined I also removed the plugin and all the platforms and reinstalled

Why does cordova-plugin-nativestorage work on browser but not on phone

笑着哭i 提交于 2019-12-08 07:14:54
问题 I am using the Phonegap CLI to serve my project and my plugin version is: 2.3.1 So, I wrote the following code to execute after the device is ready: NativeStorage.getItem("abcd",function(){ console.log("success");alert("success"); },function(){ console.log("fail");alert("failed :)"); }); This works perfectly when I am testing it on my browser. However, when I open this app on my android phone, the NativeStorage code does not work at all. I used weinre to debug my app: I got the error:

How get data from cordova-plugin-nativestorage in android java

一笑奈何 提交于 2019-12-01 17:44:23
Good day, I making native background mod for Cordova and I need get data from js to java. I save data in js with plugin cordova-plugin-nativestorage , with this code: <!DOCTYPE html> <html> <head> <title>Save data</title> <script type="text/javascript" charset="utf-8" src="cordova.js"></script> <script type="text/javascript" charset="utf-8"> function onLoad() { document.addEventListener("deviceready", onDeviceReady, false); } function onDeviceReady() { NativeStorage.setItem("somekey", "value", null, null); } </script> </head> <body onload="onLoad()"> </body> </html> but my problem is: I don’t