Skip to content
Android SDK for Amazon FreeRTOS Bluetooth Devices.
Branch: beta
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Creating initial file from template Sep 17, 2018
amazonfreertossdk
app Lower min SDK version to 23 for demo app Apr 17, 2019
documentation Add setScanFilters API Feb 20, 2019
gradle/wrapper
.gitignore Add WiFi provisioning and improve sample app Dec 21, 2018
CHANGELOG.md Update README, CHANGELOG Nov 27, 2018
CODE_OF_CONDUCT.md Creating initial file from template Sep 17, 2018
CONTRIBUTING.md Creating initial file from template Sep 17, 2018
LICENSE
NOTICE Update license Apr 8, 2019
README.md Update README.md Dec 13, 2018
build.gradle
gradle.properties Amazon FreeRTOS BLE Mobile SDK for Android Nov 22, 2018
gradlew
gradlew.bat
settings.gradle Amazon FreeRTOS BLE Mobile SDK for Android Nov 22, 2018

README.md

Amazon FreeRTOS BLE Mobile SDK for Android

Introduction

Using the Android SDK for Amazon FreeRTOS Bluetooth Devices, you can create mobile applications that do the following:

  • Scan for and connect to nearby BLE devices running Amazon FreeRTOS

  • Act as a proxy for transmitting MQTT messages between a device running Amazon FreeRTOS and the AWS IoT cloud

System requirements

  • Android 8.0 (API level 26) or higher

  • Android Studio

Setting Up the SDK

To install the Android SDK for Amazon FreeRTOS Bluetooth Devices

  1. Import amazonfreertossdk into your app project in Android Studio.

  2. In your app's gradle file, add the following dependencies:

dependencies {
    implementation project(":amazonfreertossdk")
}
  1. In your app's AndroidManifest.xml file, add following permissions:
<uses-permission android:name="android.permission.BLUETOOTH"/>
    <!-- initiate device discovery and manipulate bluetooth settings -->
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
    <!-- allow scan BLE -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <!-- AWS Mobile SDK -->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

Contents

All main functions are defined in AmazonFreeRTOSManager.java. These functions include:

BLE Helper Functions

The SDK includes some functions that help you perform BLE operations with Amazon FreeRTOS devices:

startScanBleDevices(final BleScanResultCallback scanResultCallback)
stopScanBleDevices()
connectToDevice(final BluetoothDevice bluetoothDevice, final BleConnectionStatusCallback connectionStatusCallback)
discoverServices()
close()

Device Information Service

The device information service provides basic device-related information. Its functions include:

setMtu(int mtu)
getMtu(DeviceInfoCallback callback)
getBrokerEndpoint(DeviceInfoCallback callback)
getDeviceVersion(DeviceInfoCallback callback)

MQTT Proxy Service

The MQTT proxy service controls the MQTT proxy. Its functions include:

enableMqttProxy(final boolean enable)
disconnectFromIot()

You can find the documentation for these functions in documentation.

Demo Application

The SDK includes a demo application that demonstrates some of the main features of the SDK. You can find the demo in app.

License

This library is licensed under the Apache 2.0 License.

You can’t perform that action at this time.