-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Tony Myles edited this page Jul 13, 2017
·
3 revisions
#AferoJavaSDK Overview
AferoClientRetrofit2.Config aferoClientConfig = new AferoClientRetrofit2.ConfigBuilder()
.clientId(myOAuthClientId)
.clientSecret(myOAuthClientSecret)
.logLevel(BuildConfig.HTTP_LOG_LEVEL)
.defaultTimeout(DEFAULT_SERVICE_TIMEOUT)
.imageScale(AferoClient.ImageScale.fromDisplayDensity(screenDensity))
.build();
mAferoClient = new AferoClientRetrofit2(aferoClientConfig);
mAferoClient.setOwnerAndActiveAccountId(accountId);
if (token != null) {
mAferoClient.setToken(new AccessToken(accessToken, refreshToken));
}
mDeviceCollection = new DeviceCollection(mAferoClient, ClientID.get(this));
mDeviceCollection.start();
public Observable addDevice(String associationId, boolean isOwnershipVerified)
deviceCollection.addDevice(associationId, false)
.subscribe(new Action1<DeviceModel>() {
@Override
public void call(DeviceModel deviceModel) {
// do stuff...
}
});
public Observable removeDevice(DeviceModel deviceModel)
mAferoSofthub = AferoSofthub.acquireInstance(this, mAferoClient, ClientID.get(this));
mAferoSofthub.setService(BuildConfig.AFERO_SOFTHUB_SERVICE);
DeviceWifiSetup(DeviceModel deviceModel, AferoClient aferoClient)