Skip to content

vrunoa/shared-preferences-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shared-preferences-builder Build Status

Android Shared Preferences builder

Usage

let builder = new SharedPrefsBuilder()
builder.build([
  {'type': 'string', name: 'str', value: 'im a string'},
  {'type': 'int', name: 'number', value: 1},
  {'type': 'float', name: 'f', value: 1.3},
  {'type': 'set', name: 'set', value: ['ha', 'hb']},
  {'type': 'long', name: 'long', value: 1239812738},
  {'type': 'boolean', name: 'flag', value: true}
])
console.log(builder.toString())
/**
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<map>
  <string name="str">im a string</string>
  <int name="number" value="1"/>
  <float name="f" value="1.3"/>
  <set name="set">
    <string>ha</string>
    <string>hb</string>
  </set>
  <long name="long" value="1239812738"/>
  <boolean name="flag" value="true"/>
</map>
**/
builder.toFile('com.my.package.shared.prefs.xml')

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published