I have a standard Android application which has a Cordova activity in it.
I need to access the Android preferences from within the Cordova activity.
My application uses the ionic framework, which means the following solution from Simon MacDonland (which I have used previously) no longer seems to work (as it is set up for PhoneGap):
https://github.com/macdonst/AppPreferences
My question is, does anybody know how I can access the android preferences from within Cordova when using the ionic framework? Is there a way?
Additionally, I attempted to use apla instead:
https://github.com/apla/me.apla.cordova.app-preferences
I have downloaded from the repo the plugin and it has installed successfully via the command line, however when I copy the test code they suggest into my .js file called by Cordova in my project, it says 'plugins' is undefined. The js code can be as simple as follows and result in this error:
var appp = plugins.appPreferences;
Any help as to the issue with apla, or how to get the Android preferences from Cordova would be appreciated.
I think you're looking for ngCordova, have you tried it?
In ngCordova.plugins.prefs module you've $cordovaPreferences service with get and set methods.