Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/paolorotolo/jsharedpreferences

Simple SharedPreferences interface for JavaScript.
https://github.com/paolorotolo/jsharedpreferences

Last synced: about 4 hours ago
JSON representation

Simple SharedPreferences interface for JavaScript.

Awesome Lists containing this project

README

        

JSharedPreferences
==================

Store simple strings on Android SharedPreferences.

## How To Use
Read Google's resources about how to **bind JavaScript to Android code** [here.](http://developer.android.com/guide/webapps/webview.html#BindingJavaScript)

## JavaScript API
#### Save a new string:
```
setItem(key, value)
```
#### Get a string:
```
getItem(key)
```
#### Delete a string:
```
removeItem(key)
```

*N.B. Both key and value are Strings.*

## Examples
- You can integrate a WebView on Android and use JSharedPrefernces instead of LocalStorage to save little data.
- If you want a working example [Croma](https://github.com/numixproject/com.numix.croma) is actually using JSharedPreferences.

## Credits
Developed by [Paolo Rotolo](https://github.com/PaoloRotolo) and [Satyajit Sahoo](https://github.com/satya164)