Skip to content

augmented-human-lab/kiwrious-android-library

Repository files navigation

Kiwrious Android Library Project

Library installation

android {
   defaultConfig {
      minSdkVersion 26
   }
}
dependencies {
   implementation 'com.kiwrious.sdk.android:kiwrious-android-library:1.0.2'
}
 repositories {
    mavenCentral()
}

Library usage

Modify AndroidManifest.xml

<manifest>
   <application>
      <activity>
         <!-- add new intent filter -->
         <intent-filter>
            <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
         </intent-filter>
         <!-- add new meta data -->
         <meta-data
             android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
             android:resource="@xml/device_filter" />
      </activity>
   </application>
</manifest>

Import packages

import org.ahlab.kiwrious.android.KiwriousReader;
import android.content.Context;

Initiate Reader

Context context = getApplicationContext(); // get your application context
KiwriousReader kiwriousReader = KiwriousReader.getInstance(context); // pass it to kiwrious library

Start Reader

kiwriousReader.startSerialReader();

Stop Reader

kiwriousReader.stopSerialReader();

Get raw value from sensor

byte[] getRawValues()

Get decoded Sensor value

float getConductivity()
long getResistance()
int getVoc()
int getCo2()
float getUV()
float getLux()
float getHumidity()
float getTemperature()
int getAmbientTemperature()
int getInfraredTemperature()

Get Sensor status

boolean isHumidityOnline()
boolean isUvOnline()
boolean isConductivityOnline()
boolean isVocOnline()
boolean isBodyTempOnline()

Get Connected Sensor

String getConnectedSensorName()

Copy aar plugin

  • Update into field value inside copyAndroidArchiveBinary gradle task
  • Run gradle copyAndroidArchiveBinary

Package publishing

  • create a signing key (RSA and RSA, 4096 bits long)
    gpg --full-gen-key
  • send key to a key server (keyserver.ubuntu.com, keys.openpgp.org, hkp://keys.openpgp.org)
    gpg --keyserver [key server] --send-keys [key]
  • receive same key from a key server (only for verification)
   gpg --keyserver [key server] --recv-key [key]
  • export key and copy base64 key value
    gpg --export-secret-keys [key] | base64
  • add signing properties and sonatype properties into local.properties
signing.keyId=[key]
signing.password=[passphrase]
signing.key=[base64_key_value]

ossrhUsername=[sonatype_username]
ossrhPassword=[sonatype_password]
sonatypeStagingProfileId=[sonatype_staging_id]
  • update library version inside build.gradle
ext {
    PUBLISH_VERSION = 'x.y.z'
}
  • run publish command
gradlew kiwrious:publishReleasePublicationToSonatypeRepository
  • go to nexus repository manager and login

  • under the staging repositories, find recently uploaded repository, close it and release it

  • releases are available here

  • releases are indexed here

About

Kiwrious official android development library. This library can be used for native android development as well as a plugin for Unity

Topics

Resources

License

Stars

Watchers

Forks

Languages