Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/paolorotolo/jsharedpreferences
- Owner: paolorotolo
- License: gpl-2.0
- Created: 2014-09-01T18:57:01.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-04T11:58:26.000Z (about 10 years ago)
- Last Synced: 2023-08-13T03:37:26.085Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 176 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)