nativescript-android-preferences
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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));
    }

Package Sidebar

Install

npm i nativescript-android-preferences

Weekly Downloads

1

Version

1.0.3

License

MIT

Last publish

Collaborators

  • elsamrodco