Greeting ,
   I want to use bluetooth hide API like createRfcommSocket ,
getServiceChannel , etc.,.. my program code is :

Method m = blueToothDevice.getClass().getMethod("createRfcommSocket",
new Class[] { int.class });
sock = (BluetoothSocket)m.invoke(blueToothDevice, Integer.valueOf(1));

the "createRfcommSocket" API is work very well . But
"getServiceChannel" is fail .

my program code is :


Method m_getServiceChannel = null;
                        try {
                                        m_getServiceChannel =
blueToothDevice.getClass().getMethod("getServiceChannel");
                                         // or use
"m_getServiceChannel =
blueToothDevice.getClass().getMethod("getServiceChannel", new Class[]
{ String.class, short.class});"
                                        }
                                } catch (SecurityException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                } catch (NoSuchMethodException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                } catch (IllegalArgumentException e) {
                                        // TODO Auto-generated catch block
                                        e.printStackTrace();
                                }

I always get NoSuchMethodException error . Is there anything wrong
with my procedure or the way to setup is not correct ?

----------
 int    getServiceChannel(ParcelUuid uuid)    <---- define is
BluetoothDevice.class (hide api)

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to