Git Product home page Git Product logo

misfit-sdk's Introduction

Shine SDK for Android

Overview

The current document based on the version 1.7.1.3 found on Internet - a new version is incoming with the whole "hidden" api

The Shine SDK (here for Android) provides an API to help building native applications (native as Java) to communicate directly with Misfit Shine and Misfit Flash.

Key, Terms, Concepts

  • Serial Number Represents an unique identifier associates with a Shine/Flash device. It is set during the manufacturing process.

  • Activity Represent the user movement during one minute including steps and points earned via this process

  • Point Represent a specific amount of information during an activity

  • Goal Well, you know, the goal :)

  • Firmware The Shine / Flash "program" which directs the embedded hardware inside the shell

Basic Operations

  • Scan
  • Connect
  • Configure
  • Sync
  • OTA
  • Activating the device

Supported Devices

The Shine SDK supports any Android devices with the following specifications

  • Devices with BLE compatibility
  • Android 4.3 (non Samsung)
  • Android 4.2.2 (Samsung with the BLE driver/API)

API Documentation

ShineAdapter

Return type Method
ShineAdapter ** getDefaultAdapter(Context context) **
Retrieve the singleton instance
void ** startScanning(ShineScanCallback) **
Start to scan for devices
void ** stopScanning(ShineScanCallback callback) **
Stop scanning for devices

ShineScanCallback

Return type Method
void ** onScanResult(ShineDevice device, int rssi) **
device is the instance of the Device found

ShineConfiguration

constant default value
CLOCK_STATE_DISABLE 0
CLOCK_STATE_ENABLE 1
CLOCK_STATE_SHOW_CLOCK_FIRST 2
DEFAULT_CLOCK_STATE -1
DEFAULT_ACTIVITY_POINT -1L
DEFAULT_GOAL_VALUE -1L
DEFAULT_BATTERY_LEVEL 200
public variable default value
mClockState -1
mActivityPoint -1L
mGoalValue -1L
mBatteryLevel 200

ShineDevice

Return type Method
String getSerialNumber()
String getModelNumber()
String getName()
String getAddress()
ShineProfile connectProfile(Context context, boolean auto_connect, ShineProfile.ShineCallback callback)
throws IllegalStateException

ShineProfile

constant default value
DEVICE_FAMILY_UNKNOWN 0
DEVICE_FAMILY_SHINE 1
DEVICE_FAMILY_FLASH 2
CONNECTION_STATE_CONNECTED 0
CONNECTION_STATE_DISCONNECTED 1
CONNECTION_STATE_CLOSED 2
Return type Method
ShineProfile Constructor / ShineProfile(Context context, ShineDevice device)
void connect()
boolean startGettingDeviceConfiguration()
void stopGettingDeviceConfiguration()
boolean startSettingDeviceConfiguration(ShineConfiguration configuration)
void stopSettingDeviceConfiguration()
boolean startSync()
void stopSync()
boolean startOTA(byte[] firmware_data)
void stopOTA()
boolean playAnimation()
boolean startActivating()
void stopActivating()
boolean startGettingActivationState()
void stopGettingActivationState()
String getFirmwareVersion()
String getModelNumber()
int getDeviceFamily()
boolean readRssi()
void disconnect()
void close()
ShineDevice getDevice()

ShineProfile.ShineCallback

Return type Method
void onConnectionStateChanged(int paramInt)
void onGettingDeviceConfigurationSucceeded(ShineConfiguration config)
void onGettingDeviceConfigurationFailed(ShineConfiguration config)
void onSettingDeviceConfigurationSucceeded()
void onSettingDeviceConfigurationFailed()
void onSyncSucceeded()
void onSyncFailed()
void onSyncDataRead(SyncResult result, float float, MutableBoolean should_continue)
void onOTAProgressChanged(float percent)
void onOTASucceeded()
void onOTAFailed()
void onReadRssiSucceeded(int rssi)
void onReadRssiFailed()
void onPlayAnimationSucceeded()
void onPlayAnimationFailed()
void onActivateSucceeded()
void onActivateFailed()
void onGettingActivationStateSucceeded(boolean result)
void onGettingActivationStateFailed()

SDKSetting

Return type Static Method
void setUp(Context applicationContext, String userId)
String getUserId()
void validateSettings()

MisfitDevice

Base class for ShineDevice

MutableBoolean

Return type Method
void setValue(boolean value)
boolean getValue()

misfit-sdk's People

Contributors

codlab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

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.