It is better to use the general Android setting, you can install it with a plugin. Here are the steps:
1 In your javascript add this
function storeJSON(JSON_String){
cordova.exec(function() {
}, function(error) {
}, "YOUR_CUSTOM_CLASS", [JSON_String,"SET"]);
}
function getJSON(){
cordova.exec(function(Json) {
alert(Json);
}, function(error) {
}, "YOUR_CUSTOM_CLASS", ["","GET"]);
}
2 Create the Java class YOUR_CUSTOM_CLASS. Download
3 In config.xml add this
<feature name="YOUR_CUSTOM_CLASS">
<param name="android-package" value="yourpackage.YOUR_CUSTOM_CLASS" />
</feature>
source
share