Reputation: 6121
Sorry for my English, it's not my native language.
I want to develop application with this basic functionality:
Well, there is plently of other functionality, like reminders and stuff, but it's not linked to this choice of bare JSON, nosql db or sqlite.
The question is what is more suitable for this functionality?
For example :
Upvotes: 4
Views: 1548
Reputation: 469
ThingDB is an embeddable NoSQL database with MongoDB-Like API:
DB db = new DB("./db");
Doc doc=new Doc();
doc.put("name","test");
doc.put("age",31);
db.insert(doc);
//later you can find the saved doc:
Doc d=db.findOne(eq("name","test"));
You can also convert a Doc to a org.json.JSONObject:
JSONObject jo=d.toJSONObject();
https://github.com/neo-expert/thingdb
Upvotes: 0
Reputation: 38207
As this has not been proposed yet, SnappyDB has a very simple API, and is a NoSQL-database for android. It can persist any object (says the website). It is used like so
try {
DB snappydb = DBFactory.open(context); //create or open an existing databse using the default name
snappydb.put("name", "Jack Reacher");
snappydb.putInt("age", 42);
snappydb.putBoolean("single", true);
snappydb.put("books", new String[]{"One Shot", "Tripwire", "61 Hours"});
String name = snappydb.get("name");
int age = snappydb.getInt("age");
boolean single = snappydb.getBoolean("single");
String[] books = snappydb.getArray("books", String.class);// get array of string
snappydb.close();
} catch (SnappydbException e) {
}
Storing a serializable object:
AtomicInteger objAtomicInt = new AtomicInteger (42);
snappyDB.put("atomic integer", objAtomicInt);
AtomicInteger myObject = snappyDB.get("atomic integer", AtomicInteger.class);
Storing any object:
MyPojo pojo = new MyPojo ();
snappyDB.put("my_pojo", pojo);
MyPojo myObject = snappyDB.getObject("non_serializable", MyPojo.class);
Upvotes: 0
Reputation: 1034
Couchbase Lite is an embedded native NoSQL database for iOS and Android. It stores JSON documents and transparently syncs them via your cloud servers to other devices, with a security model designed for fine grained access control in multi-user interactive applications.
Github repos here:
Mailing list here: https://groups.google.com/forum/#!forum/mobile-couchbase
Upvotes: 1
Reputation: 326
Here are a few ideas -
couchDB is considered a good type of key-value store for replication across multiple servers/clients. This is probably an appropriate type of database for the problem you are describing.
Otherwise, using any kind of SQL/noSQL style database with a REST access point will work in your scenario. I think MongoDB is a particularly good choice because despite being key/value store it it quick to learn for someone coming from the SQL word - it also returns answers to your queries in json - so if you using something like NodeJS as your REST server it can simplify things a fair bit.
As for general structure of your application - have a look at the docs for asana at http://developer.asana.com/documentation/ - It should give you a good starting point.
Upvotes: 0