Java tutorial
//package com.java2s; import java.lang.reflect.Method; import android.bluetooth.BluetoothDevice; public class Main { public static boolean createBond(Class btClass, BluetoothDevice btDevice) throws Exception { Method createBondMethod = btClass.getMethod("createBond"); Boolean retVal = (Boolean) createBondMethod.invoke(btDevice); return retVal.booleanValue(); } }