import { Component } from "@angular/core" ; import { ApplicationSettings } from "@nativescript/core" ; @ Component ( { moduleId : module . id , templateUrl : "./usage.component.html" } ) export class UsageComponent { constructor ( ) { ApplicationSettings . setBoolean ( "isTurnedOn" , true ) ; ApplicationSettings . setString ( "username" , "Wolfgang" ) ; ApplicationSettings . setNumber ( "locationX" , 54.321 ) ; const isTurnedOn = ApplicationSettings . getBoolean ( "isTurnedOn" ) ; const username = ApplicationSettings . getString ( "username" ) ; const locationX = ApplicationSettings . getNumber ( "locationX" ) ; const someKey = ApplicationSettings . getString ( "noSuchKey" , "No string value" ) ; let isKeExisting = ApplicationSettings . hasKey ( "noSuchKey" ) ; } onClearß ( ) { ApplicationSettings . remove ( "isTurnedOn" ) ; ApplicationSettings . clear ( ) ; } }