Skip to content
A NativeScript plugin that allows to use the application's preferences on Android.
JavaScript CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
.gitignore
.npmignore
LICENSE
README.md
android-preferences.js
index.d.ts
package.json

README.md

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));
    }
You can’t perform that action at this time.