This Android library allows your app to access Keecker features. It provides a low-level access to sensors and movement, as well as higher-level information:
Add the JitPack repository in your root build.gradle at the end of repositories.
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency, replace Tag by the latest version: JitPack.
dependencies {
implementation 'com.github.keecker:services-api:Tag'
}
In your main AndroidManifest.xml, add the following permission to be allowed to move the projector:
<manifest>
....
<uses-permission android:name="com.keecker.permission.PROJECTION" />
Add the code that will actually move the projector in your activity:
fun wobbleProjector() {
val projector = KeeckerServices.getProjectorClient(applicationContext)
GlobalScope.launch(Dispatchers.IO) {
while (true) {
projector.setState(ProjectorState(orientation = 0))
delay(5000)
projector.setState(ProjectorState(orientation = 90))
}
}
}
At the moment you can use the following clients:
ProjectorClient
, requiring the com.keecker.permission.PROJECTION
permission.PerceptionClient
, requiring the com.keecker.permission.PERCEPTION
permission.MovementClient
, requiring the com.keecker.permission.MOVEMENT
permission.This is not needed to use the library, add it to your project as described above. However, you may be interested to run some of the tests that show how Android handles IPC and permissions.
You need a working Android development environment to compile this library. Follow the instructions on the official website.
Generate the library.
./gradlew assembleRelease
Unit tests specify and test the logic behind API Clients.
./gradlew test
Then check the report in build/reports/tests
Android tests show how Android handles IPC and permissions, and what to expect from it. You will need a plugged Android device or emulator to run those tests.
./gradlew connectedAndroidTest
Then check the report in build/reports/tests
Coding style is not yet tested, we follow the Google coding styles:
Licensed under the Apache License, Version 2.0 - see the LICENSE.md file for details.