Android Bluetooth PIN pairing without user interface on Android 4.2+ -
there similar questions here already, answers , suggestions relate older versions of android. understand bluetooth stack has been revised 4.2 onwards , older solutions not work anymore.
i have tried older solutions no avail. use of private apis no longer works because have changed. dont mind using private apis must work on newest versions , later (ie api 17+)
i trying following:
set bluetooth pairing between android device , embedded device using legacy pin pairing without embedded device being discoverable nor user having manually enter pin. in fact want no pin entry dialog box @ all.
the plan 2 devices have predefined shared secret pin, can perform pairing programmatically , open rfcomm connection between them. of without ui. hardware address of embedded device known android program.
there no security issue here. project involves talking nearyby, small embedded device through bt simple possible.
ideas might work on android 4.2 (jelly bean) welcome, thanks.
turns out of problem inside embedded device. on android side, following works:
bluetoothsocket s = null;
try { s = device.createinsecurerfcommsockettoservicerecord(serialportserviceclass_uuid); } catch (ioexception e) { log.e(tag, "bt connect failed", e); return false; } where
private static final uuid serialportserviceclass_uuid = uuid.fromstring("00001101-0000-1000-8000-00805f9b34fb");
Comments
Post a Comment