private void pairDevice(BluetoothDevice device) {    // 可以配對成功
        try {
            Log.d("pairDevice()", "Start Pairing...");
        	device.getClass().getMethod("setPairingConfirmation", boolean.class).invoke(device, true);
        	device.getClass().getMethod("cancelPairingUserInput", boolean.class).invoke(device);
            Log.d("pairDevice()", "Pairing finished.");
        } catch (Exception e) {
            Log.e("pairDevice()", e.getMessage());

By admin-powenko

Dr. Powen Ko is a teacher and CEO on LoopTek LLC, and like to teaching. if you need to class, please let PowenKo know, he will love to service and sharing. LoopTek web site is

Leave a Reply