Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h2>After days of struggling, I've now managed to do it, cheers :)</h2> <ol> <li>Add android.bluetooth.IBluetoothA2dp.aidl in your /src dir of your app;</li> <li><p>Add this private method in your code:</p> <pre><code>private IBluetoothA2dp getIBluetoothA2dp() { IBluetoothA2dp ibta = null; try { Class c2 = Class.forName("android.os.ServiceManager"); Method m2 = c2.getDeclaredMethod("getService", String.class); IBinder b = (IBinder) m2.invoke(null, "bluetooth_a2dp"); Log.d("Felix", "Test2: " + b.getInterfaceDescriptor()); Class c3 = Class.forName("android.bluetooth.IBluetoothA2dp"); Class[] s2 = c3.getDeclaredClasses(); Class c = s2[0]; // printMethods(c); Method m = c.getDeclaredMethod("asInterface", IBinder.class); m.setAccessible(true); ibta = (IBluetoothA2dp) m.invoke(null, b); } catch (Exception e) { Log.e("flowlab", "Erroraco!!! " + e.getMessage()); } </code></pre></li> <li><p>Test it with this:</p> <pre><code>private void testBluetoothA2dp(BluetoothDevice device) { // TODO Auto-generated method stub // TODO Auto-generated method stub IBluetoothA2dp ibta = getIBluetoothA2dp(); try { Log.d("Felix", "Here: " + ibta.getSinkPriority(device)); ibta.connectSink(device); } catch (RemoteException e) { // * TODO Auto-generated catch block e.printStackTrace(); } </code></pre> <p>}</p></li> </ol> <p>I'm not able to provide references of these code since I've spent lots of time googling, checking out stackoverflow, and reviewing Android source code, but failed to keep track of sources. Many thanks to you guys in Stackoverflow :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload