Official android SDK for Kuzzle
Latest commit 7a358f2 Dec 29, 2016 @jenow jenow committed on GitHub Update

Build Status Download Join the chat at

Official Kuzzle Android SDK

This SDK version requires Kuzzle v1.0.0-RC8 or higher.

About Kuzzle

For UI and linked objects developers, Kuzzle is an open-source solution that handles all the data management (CRUD, real-time storage, search, high-level features, etc).

You can access the Kuzzle repository on Github

SDK Documentation

The complete SDK documentation is available here


You can configure your android project to get the Kuzzle's android SDK from jcenter in your build.gradle:

buildscript {
    repositories {
compile 'io.kuzzle:sdk-android:2.1.0'

Basic usage

Kuzzle kuzzle = new Kuzzle("host", new ResponseListener<Void>() {
public void onSuccess(Void object) {
    // Handle success
    KuzzleDocument doc = new KuzzleDocument(dataCollection);
    doc.setContent("foo", "bar").save();

public void onError(JSONObject error) {
    // Handle error


KuzzleDocument is an encapsulation of a JSONObject.

KuzzleDataCollection myCollection = new KuzzleDataCollection(kuzzle, "myNewCollection");
KuzzleDocument myDocument = new KuzzleDocument(myCollection);
// Add properties to the body
myDocument.setContent("foo", "bar");
// Persist the document;
// Send it on real time (not persistent)

Adding metadata

As stated here you can add metadata to a subscription.

KuzzleOptions options = new KuzzleOptions();
JSONObject metadata = new JSONObject();
metadata.put("foo", "bar");



To login using kuzzle you need at least one authentication plugin. You can refer here for a local authentication plugin or here to refer to an OAuth plugin with github.

Login with local strategy

If you have the kuzzle-plugin-auth-passport-local installed you can login using either the Kuzzle's constructor or the login method.

KuzzleOptions options = new KuzzleOptions();
kuzzle = new Kuzzle("localhost", options);

Login with an OAuth strategy

If you have an OAUTH plugin like kuzzle-plugin-auth-passport-oauth you can login and use the KuzzleWebViewClient to make it easier to handle.

Handler handler = new Handler();
WebView webView = (WebView) findViewById(;
kuzzle.login("github", new KuzzleResponseListener<JSONObject>() {
      public void onSuccess(final JSONObject object) { Runnable() {
          public void run() {
            try {
              if (object.has("headers")) {
            } catch (JSONException e) {

      public void onError(JSONObject error) {
        Log.e("error", error.toString());


You can find the java doc of the SDK here: