Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;

public class Main {
    public static BluetoothDevice getDeviceByAddress(String address) {
        BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
        for (BluetoothDevice device : mBluetoothAdapter.getBondedDevices()) {
            if (device.getAddress().equals(address)) {
                return device;
            }
        }

        return null;
    }
}