Java tutorial
//package com.java2s; //License from project: Apache License import android.bluetooth.BluetoothDevice; import java.lang.reflect.Method; public class Main { public static boolean createBond(BluetoothDevice device) throws Exception { Method createBondMethod = device.getClass().getMethod("createBond"); return (Boolean) createBondMethod.invoke(device); } }