SDK For Data Streaming
Android
6min
installation add the jitpack repository to your build file in your root build gradle at the end of repositories allprojects { repositories { maven { url 'https //jitpack io' } } } add qualetics sdk to your apps build gradle file dependencies { implementation 'com gitlab qualetics sdk\ qualetics android\ c1150c95c0' } in the same file under application tag you need to define mqtt client service which is used as protocol for communicating with qualetics servers \<application> \<service android\ name="org eclipse paho android service mqttservice">\</service> \</application> usage to use the sdk it first needs to be initialized qualeticsservice qualetics = new qualeticsservice(getapplicationcontext(), application id, application secret); to set the appversion parameter that is sent with the messages you can set it with qualetics setappversion("\<your android app's version>"); to set default actor that will be sent with all messages without defined actor hashmap attrs = new hashmap\<string, object>(); attrs put("key", "value"); qualetics usedefaultactor(new actor("type", "id", new actor("type", "id", attrs)); to set default actor to be stored from api call qualetics storedefaultactorfromapicall(); then connect to server qualetics connect(); after connection is initialized it can be used to send events to the server qualeticsmessage message = new messagebuilder() action(new action("buttonclick", null)) actor(new actor("user", "1234", null)) context(new context("button", "button1", null)) object(new qualeticsobject("button", "button1", null)) build(); qualeticsservice sendmessage(message);