nativescript-android-preferences
A NativeScript plugin that allows to use the application's preferences on Android.
npm i --save nativescript-android-preferences
- Version: 1.0.3
- GitHub: https://github.com/elsamrodco/nativescript-android-preferences
- NPM: https://www.npmjs.com/package/nativescript-android-preferences
- Downloads:
- Last Day: 0
- Last Week: 0
- Last Month: 0
NativeScript-Android-preferences
A NativeScript plugin that allows to use the application's preferences on Android.
License
This plugin is licensed under the MITlicense by Elsa Rodriguez Plaza
Installation
tns plugin add nativescript-android-preferences
Usages
For more details on how to use this plugin, take a look at the demo application
<Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="onNavigatingTo">
<StackLayout>
<Label text="Android App Save Preferences" class="title"/>
<Button text="Save String" tap="{{ onTapString }}" />
</StackLayout>
</Page>
var pref = require("nativescript-android-preferences");
onTapString = function () {
var options = {
datavalue: "StringPreference",
datatype: pref.DataTypes.STRING,
prefname: "String_Preference"
}
pref.SavePreference(options);
options.datavalue = "DefStringPreference";
alert("String Preference saved:"+pref.GetPreference(options));
}