Giter Site home page Giter Site logo

services-api's Introduction

Keecker Services API

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:

  • Front and 360 cameras
  • Depth camera and proximity sensors
  • Movement commands and location on the map
  • Wall and charging station detection

Getting Started

Prerequisites

  • You will need Android Studio, check the install instructions on the official website.
  • You may want to check "Build your first app" on the Android developer website.
  • Create a new Android TV app, preferably using the Kotlin language.

Add the library in your Android app

  1. Add the JitPack repository in your root build.gradle at the end of repositories.

        allprojects {
            repositories {
                ...
                maven { url 'https://jitpack.io' }
            }
        }
  2. Add the dependency, replace Tag by the latest version: JitPack.

         dependencies {
             implementation 'com.github.keecker:services-api:Tag'
         }

Use the Keecker Services

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.

Building

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.

Compiling

Generate the library.

./gradlew assembleRelease

Unit test

Unit tests specify and test the logic behind API Clients.

./gradlew test

Then check the report in build/reports/tests

Android 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 tests

Coding style is not yet tested, we follow the Google coding styles:

License

Licensed under the Apache License, Version 2.0 - see the LICENSE.md file for details.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.