All Projects → mbientlab → MetaWear-SDK-Android

mbientlab / MetaWear-SDK-Android

Licence: other
MetaWear Java SDK - Android - Google - Android Studio

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to MetaWear-SDK-Android

MetaWear-SDK-JavaScript
MetaWear JavaScript SDK - Linux - Node.JS
Stars: ✭ 28 (-56.25%)
Mutual labels:  bluetooth-le, metawear, metamotion
MetaWear-SDK-Cpp
MetaWear C++ SDK - Platform Agnostic - Main lib - No Bluetooth
Stars: ✭ 42 (-34.37%)
Mutual labels:  bluetooth-le, metawear, metamotion
MetaWear-SDK-Python
MetaWear Python SDK - Linux / Windows - Python3
Stars: ✭ 43 (-32.81%)
Mutual labels:  bluetooth-le, metawear, metamotion
Ble Hid Peripheral For Android
BLE HID over GATT Profile for Android
Stars: ✭ 143 (+123.44%)
Mutual labels:  bluetooth-le
Ble
Connect to and interact with Bluetooth LE peripherals.
Stars: ✭ 156 (+143.75%)
Mutual labels:  bluetooth-le
Apple-TV-Remote
Control your Apple TV from OS X Notification Center
Stars: ✭ 17 (-73.44%)
Mutual labels:  bluetooth-le
uberducky
Wireless USB Rubber Ducky triggered via BLE (make your Ubertooth quack!)
Stars: ✭ 80 (+25%)
Mutual labels:  bluetooth-le
Ruuvitag Sensor
Python library for communicating with RuuviTag BLE Sensor Beacon and for decoding sensor data from broadcasted data
Stars: ✭ 136 (+112.5%)
Mutual labels:  bluetooth-le
pinetime-companion
Flutter Companion App for PineTime Smart Watch (Android and iOS)
Stars: ✭ 51 (-20.31%)
Mutual labels:  bluetooth-le
py-bluetooth-utils
Python module containing bluetooth utility functions, in particular for easy BLE scanning and advertising
Stars: ✭ 60 (-6.25%)
Mutual labels:  bluetooth-le
PiBeacon
Low-cost iBeacon using Raspberry Pi
Stars: ✭ 41 (-35.94%)
Mutual labels:  bluetooth-le
Gatt Python
Bluetooth GATT SDK for Python
Stars: ✭ 233 (+264.06%)
Mutual labels:  bluetooth-le
Node Ble
Bluetooth Low Energy (BLE) library written with pure Node.js (no bindings) - baked by Bluez via DBus
Stars: ✭ 159 (+148.44%)
Mutual labels:  bluetooth-le
Easyble
Android BLE framework
Stars: ✭ 155 (+142.19%)
Mutual labels:  bluetooth-le
gobot
Golang framework for robotics, drones, and the Internet of Things (IoT)
Stars: ✭ 7,869 (+12195.31%)
Mutual labels:  bluetooth-le
Ble.net
Cross-platform Bluetooth Low Energy (BLE) library for Android, iOS, and UWP
Stars: ✭ 137 (+114.06%)
Mutual labels:  bluetooth-le
Esp32 Ble Mouse
Bluetooth LE Mouse library for the ESP32 (Arduino IDE compatible)
Stars: ✭ 180 (+181.25%)
Mutual labels:  bluetooth-le
bluetooth
Android Bluetooth examples
Stars: ✭ 80 (+25%)
Mutual labels:  bluetooth-le
app
CovidTrace mobile app.
Stars: ✭ 19 (-70.31%)
Mutual labels:  bluetooth-le
cloudbbq
A Bluetooth to MQTT bridge for the Tenergy Solis Digital Meat Thermometer and other similar devices.
Stars: ✭ 36 (-43.75%)
Mutual labels:  bluetooth-le

MetaWear Android API

The MetaWear Android API is a library for interacting with MbientLab's sensor boards on an Android device. A minimum of Android 7.0 (SDK 24) is required to use this library, however for the best results, it is recommended that users be on Android 10 (SDK 29) or higher.

Setup

Adding Compile Dependency

To add the library to your project, first, update the repositories closure to include the MbientLab Ivy Repo in the project's
build.gradle file.

repositories {
    ivy {
        url "https://mbientlab.com/releases/ivyrep"
        layout "gradle"
    }
}

Then, add the compile element to the dependencies closure in the module's build.gradle file.

dependencies {
    compile 'com.mbientlab:metawear:3.8.2'
}

If you are using SDK v3.3 or newer, you will need to enable Java 8 feature support the module's build.gradle file. See this page in the Android Studio user guide.

Declaring the Service

Once your project has synced with the updated Gradle files, declare the MetaWear Bluetooth LE service in the module's AndroidManifest.xml file.

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <service android:name="com.mbientlab.metawear.android.BtleService" />
    <!-- Other application info below i.e. activity definitions -->
</application>

Binding the Service

Lastly, bind the service in your application and retrain a reference to the service's LocalBinder class. This can be done in any activity or fragment that needs access to a MetaWearBoard object.

import android.app.Activity;
import android.content.*;
import android.os.Bundle;
import android.os.IBinder;

import com.mbientlab.metawear.android.BtleService;

public class ExampleActivity extends Activity implements ServiceConnection {
    private BtleService.LocalBinder serviceBinder;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ///< Bind the service when the activity is created
        getApplicationContext().bindService(new Intent(this, BtleService.class),
                this, Context.BIND_AUTO_CREATE);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();

        ///< Unbind the service when the activity is destroyed
        getApplicationContext().unbindService(this);
    }

    @Override
    public void onServiceConnected(ComponentName name, IBinder service) {
        ///< Typecast the binder to the service's LocalBinder class
        serviceBinder = (BtleService.LocalBinder) service;
    }

    @Override
    public void onServiceDisconnected(ComponentName componentName) { }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].