Android Open Source - AndroidBleLib Stored Bluetooth Device






From Project

Back to project page AndroidBleLib.

License

The source code is released under:

MIT License

If you think the Android project AndroidBleLib listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package io.hearty.ble.lib.data;
/*from   w w  w .ja va2s.  c o  m*/
import android.bluetooth.BluetoothDevice;

import java.util.Comparator;

/**
 * Created by ejf3 on 5/16/14.
 *
 * BluetoothDevice is final, so couldn't simply extend it
 */
public class StoredBluetoothDevice implements Comparator<StoredBluetoothDevice> {
    private final BluetoothDevice device;

    public StoredBluetoothDevice(BluetoothDevice device) {
        this.device = device;
    }

    @Override
    public int compare(StoredBluetoothDevice x, StoredBluetoothDevice y) {
        return x.getAddress().compareTo(y.getAddress());
    }

    public BluetoothDevice getDevice() {
        return device;
    }

    public String getAddress() {
        return device.getAddress();
    }

    public String getName() {
        return device.getName();
    }
}




Java Source Code List

io.hearty.ble.lib.BleScanner.java
io.hearty.ble.lib.data.BleConnect.java
io.hearty.ble.lib.data.DeviceFound.java
io.hearty.ble.lib.data.HeartRate.java
io.hearty.ble.lib.data.StoredBluetoothDevice.java
io.hearty.ble.lib.heart.BleHeartService.java
io.hearty.ble.lib.utils.BlePrefs.java
io.hearty.ble.lib.utils.BleUtils.java
io.hearty.ble.lib.utils.SampleGattAttributes.java