How can I avoid or dismiss Android’s Bluetooth pairing notification when I am doing programmatic pairing? 藍芽配對動作

December 28, 2013   ·   0 Comments

Screen Shot 2014-11-17 at 9.53.12 AM
 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());
        }
    }
shareShare on FacebookShare on Google+Share on LinkedInEmail this to someonePrint this pageBuffer this pageDigg thisFlattr the authorShare on RedditPin on PinterestShare on StumbleUponShare on TumblrTweet about this on Twitter

By


Readers Comments (0)


You must be logged in to post a comment.

PowenKo’s Online Store

powenko_arduinoBook
Android7

Amazon

adsbygoogle

Recent Posts

Categories

Amazon