Mongodb Android

 
I'm going to revive this thread and say that MongoDB's Java driver IS currently compatible with Android. Some novice developers might have trouble getting their apps to use MongoDB's java library, so I'll just outline what you have to do (though all of this could be obsolete by the time you're reading this).
Go to your app build.gradle file. Add this "compile" entry under your dependencies (you will probably have to replace the version):
dependencies {
  ...
  compile 'org.mongodb:mongo-java-driver:3.0.3'
}

As you can see, the driver's version as of this post is 3.0.3. You can find the current version by searching "mongo-java-driver" or any related terms at http://search.maven.org.
If you're connecting to an external database, you will of course need to add the INTERNET permission to your manifest. Connecting to one is pretty simple. Here's an example. Replace the username, password, host domain, port, and database name:

MongoClientURI uri = new MongoClientURI( "mongodb://username:password@www.example.com:12345/db-name" );
MongoClient mongoClient = new MongoClient(uri);
MongoDatabase db = mongoClient.getDatabase(uri.getDatabase());

Komentar