开发者

Android + NoSQL

I am developing an app which is supposed to send data to a MySQL DB in a remote server so as to be later displayed in a webpage that grabs the data from that server, and I was wondering if it's possible to use some NoSQL solution instead of MySQL?

I have 开发者_运维知识库been reading about CouchDB and MongoDB but I still don't understand if I could use them for my purposes, as for example with MongoDB, I have to install the app on the Android phone and I still have no clue how I can install it in a remote server.


CouchBase Mobile is probably what you are looking for. I don't think there is an equivalent solution for MongoDB yet, and it's not really what it is designed for anyway.

EDIT: But what is wrong with the MySQL option?


iBoxDB for Java can install in the Android emulator,hava an interface called 'IBoxRecycler' , it can collect database's data(byte[]) , then convert data to sql, and replicate to server. if server also iBoxDB, just send data don't need convert

for (OPEntity k : BoxData.getActions()) {
  String tableName = k.TableName;
  Map<String, Object> v = k.Select();
  String sql = ( tableName, v ) to SQL;
  SendToMySQL( sql );
}

https://github.com/iboxdb/forjava


A new kid on the block is JasDB. It has an exceedingly simple API and works on Android. Examples:

create object

SimpleEntity entity = new SimpleEntity();
entity.addProperty("title", "Title of my content");
entity.addProperty("text", "Some big piece of text content");
bag.addEntity(entity);

range query

QueryExecutor executor = bag.find(QueryBuilder.createBuilder().field("age")
   .greaterThan(10).field("age").smallerThan(30).sortBy("country"));


There is also

https://github.com/neo-expert/thingdb

It is very lightweight (~50 KB) The API is MongoDB-like:

DB db = new DB("./db");
Doc doc=new Doc();
doc.put("name","test");
doc.put("age",31);
db.insert(doc);
//later you can get the saved doc:
Doc d=db.findOne(eq("name","test"));

You can also create Indexes:

db.createIndex("fieldname");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜