android - Converting a IntPtr bluetooth socket instance to a native monodroid BlueToothSocket? -


i'm using jni intptr bluetooth connection method. code is:

intptr createrfcommsocket = jnienv.getmethodid(device.class.handle, "createrfcommsocket", "(i)landroid/bluetooth/bluetoothsocket;"); intptr socket = jnienv.callobjectmethod(device.handle, createrfcommsocket, new jvalue(1)); 

is there anyway convert intptr socket native monodroid bluetoothsocket?

i need offer single interface create bluetooth socket method.

is there anyway convert intptr socket native monodroid bluetoothsocket?

if "native monodroid bluetoothsocket" mean bluetoothsocket, use java.lang.object.getobject<t>() method:

var msocket = java.lang.object.getobject<android.bluetooth.bluetoothsocket>(socket, jnihandleownership.transferlocalref); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -