Java tutorial
//package com.java2s; import android.bluetooth.BluetoothDevice; import java.lang.reflect.Method; public class Main { static public void setPairingConfirmation(Class<?> btClass, BluetoothDevice device, boolean isConfirm) throws Exception { Method setPairingConfirmation = btClass.getDeclaredMethod("setPairingConfirmation", boolean.class); setPairingConfirmation.invoke(device, isConfirm); } }