Enabled Device API
A lightweight API to obtain AEVI enabled device information at runtime.
Terminology
- DMS - Device Management System
- MDM - Mobile Device Manager
- UIN - Unique Installation Number
Dependencies
The enabled-device-api is published to Bintray. Add the following snippet to your top-level build.gradle repositories DSL:
build.gradle - repositories
maven {
url "http://dl.bintray.com/aevi/aevi-uk"
}
Then, in your application build.gradle:
app build.gradle
implementation "com.aevi.dms:enabled-device-api:<version>"
DMS Client
dmsClient = new DmsClient(this);
The DMS client provides easy access to the UIN and current user permissions on an enabled device.
The DMS client can be obtained by passing the activity context to a new DmsClient instance.
DMS Info
dmsClient
.info()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
dmsInfo -> onData(dmsInfo),
this::onError)
The DmsInfo provides the devices UIN. The following example demonstrates how to retrieve the dmsInfo.
DMS Account
dmsClient
.loggedInAccount()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
account -> onData(roleField, account.getRole().name()),
this::onError)
The DmsAccount provides the permissions of the current user, Account
is retrieved in much the same way as the DmsInfo.
See the complete Sample App for more information.
Agent Emulator
The SimulatorApp is provided to simulate the AEVI Agent on development environments; the SimulatorApp must be installed before the DMS-client and can't be installed on a device with an existing Agent. The simulator app returns a null UIN by default, this can be changed manually to match a project specific example inside of the app.