Create Bluetooth Bond - Android Bluetooth

Android examples for Bluetooth:Bluetooth Bond

Description

Create Bluetooth Bond

Demo Code


//package com.java2s;

import java.lang.reflect.Method;

import android.bluetooth.BluetoothDevice;

public class Main {

    static public boolean createBond(Class btClass, BluetoothDevice btDevice)
            throws Exception {

        Method createBondMethod = btClass.getMethod("createBond");

        Boolean returnValue = (Boolean) createBondMethod.invoke(btDevice);

        return returnValue.booleanValue();

    }//from w  ww.  ja  v a  2 s.  c  o m
}

Related Tutorials