Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.List;
import java.util.UUID;
import android.bluetooth.BluetoothGattCharacteristic;

public class Main {
    public static BluetoothGattCharacteristic findCharacteristic(UUID uuid,
            List<BluetoothGattCharacteristic> gattCharacteristics) {
        if (gattCharacteristics != null && gattCharacteristics.size() > 0) {
            for (BluetoothGattCharacteristic gattCharacteristic : gattCharacteristics) {
                if (gattCharacteristic != null) {
                    if (gattCharacteristic.getUuid().equals(uuid)) {
                        return gattCharacteristic;
                    }
                }
            }
        }
        return null;
    }
}