An Apple's CloudKit library for Android. If you have an iOS App with CloudKit now you can use the contents on Android too.

It's like dancing with the devil.


Configure AndroidManifest.xml

You have to add the activity definition to Android Manifest. This activity opens a WebView to do the authentication with CloudKit

<activity android:name="net.moddity.droidnubekit.ui.DNKWebViewAuthActivity" />

Init DroidNubeKit

From your main activity

            "YOUR TOKEN", //your api token
            DroidNubeKitConstants.kEnvironmentType.kDevelopmentEnvironment, //development or production

Configure your models

The models must extend DNKObject and uses annotations to give knowledge of your schema to the lib.


This project uses annotations to know some things about your scheme

//Defines the recordtype. Must match one on CloudKit dashboard.

//The record ID

//Defines one field and his type. Ex: @CKField(DNKFieldTypes.STRING) 

//A list of objects references AKA: REFERENCE_LIST Ex: @CKReference(CarExtras.class) 

An example of a car model will be:

public class Car extends DNKObject implements Serializable {

    public String carID;

    private CarBrand carBrand;

    public String comment;

    public List<CarExtras> extras = new ArrayList<>();