Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/mwbrooks/phonegap-plugin-hashpipe

A PhoneGap plugin to create a hash table database - similar to DOMStorage - with Lawnchair support.
https://github.com/mwbrooks/phonegap-plugin-hashpipe

Last synced: 18 days ago
JSON representation

A PhoneGap plugin to create a hash table database - similar to DOMStorage - with Lawnchair support.

Awesome Lists containing this project

README

        

PhoneGap Hashpipe Plugin
========================

> Store JSON with the platform's SDK.

A PhoneGap plugin to create a hash table database using the platform's SDK. The concept is similar to [DOM Storage / Web Storage](https://developer.mozilla.org/en/dom/storage), with the bonus of no database size restriction.

Supports [Lawnchair](https://github.com/xui/lawnchair) using the [BlackBerry PersistentStore adapter](https://github.com/xui/lawnchair/blob/master/src/adaptors/BlackBerryPersistentStorageAdaptor.js).

Supported PhoneGap Platforms
----------------------------

- BlackBerry WebWorks (5.0 & 6.0)

Directory Structure
-------------------

build.xml ....... Easily build and deploy the plugin
plugin/ ......... PersistentStore plugin implementation
plugin/src/ ..... Java implementation
plugin/www/ ..... Web implementation
test/ ........... Test application using Lawnchair's test-suite

Using the Plugin with your Project
----------------------------------

### 1. Build the plugin

ant build

### 2. Install Java Library

Copy `./plugin/build/www/ext/hashpipe.jar`

To `c:/my-app/www/ext/hashpipe.jar`

### 3. Install Web Assets

Copy `./plugin/build/www/javascript/hashpipe.js`

To `c:/my-app/www/javascript/hashpipe.js`

### 4. Include the JavaScript

### 5. Create Lawnchair Instance


document.addEventListener('deviceready', function() {
window.adapter = 'blackberry';

try {
new Lawnchair({adaptor:window.adapter}, function(){
var database = this;
// database.get(...);
// database.save(...);
});
}
catch(e) {
alert(e);
}
}, false);

Running the Tests
-----------------

### Configuration

Specify your SDK location in `test/project.properties`:

bbwp.dir=C:\\Program Files (x86)\\Research In Motion\\BlackBerry Widget Packager

### Build and Deploy

ant help
ant load-device # build plugin and run tests on a device
ant load-simulator # build plugin and run tests on a simulator

Plugin Development
------------------

### Java

plugin/src/com/phonegap/plugins

### Web

plugin/www

Contributors
------------

- [filmaj](https://github.com/filmaj)
- wrote [PhoneGap BlackBerry 4.6 PersistentStore](https://github.com/filmaj/phonegap-blackberry/blob/master/js/src/store.js) implementation
- wrote Lawnchair BlackBerry PersistentStore adapter
- [bryfox](https://github.com/bryfox)
- testing and feedback

Future Work
-----------

- Extract BlackBerry 4.6 Store implementation to this plugin
- Change JavaScript API
- Rewrite Lawnchair plugin and rebrand to Hashpipe
- Add iOS Core Data implementation