Created
March 17, 2015 17:45
-
-
Save larrytech7/e49b911769ed677f255f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# JSON_DB | |
This is a NoSQL implementation of a local database for android. It uses the JSON APIs amongst other standard Android APIs. It can be used to setup a quick NoSQL database in android. It has the same advantages as any other NoSQL database. It is easy to setup and to get started. | |
Getting started Guide | |
Installation | |
To use the library in yoUr project , just import the bin/json_db.jar file into your class path. | |
however , you could also add the project as an external Library in eclipse by adding it under the libraries in your project configuration. | |
Usage | |
just like any other database , one can store and retrieve data. | |
To store data say a set of devices, the following code is used | |
Context context = this ; | |
String datakey = "DEVICES"; | |
JSON_DB myDb = new JSON_DB(context ,datakey); | |
// here you can loop through a set of data and populate an arraylist | |
String[] mdevices = {}; | |
ArrayList<String> myList= new ArrayList<String>(); | |
for(String dev1 : mdevices){ | |
myList.add(dev1); | |
} | |
myDb.put(mdevices).save(); //this lines saves the data | |
To retrieve the data, all you need is to get a reference to your database handler and call get on ther object. | |
JSON_DB mDB = new JSON_DB (context , datakey ); | |
ArrayList mylist =mDB.get(); | |
Here , the ArrayList object contains a list of all the devices stored in it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist describes how to use the library to add support for NoSQL on android for your applications.