Sunday, April 21, 2013

Jelly Bean 4.2 Now Supported & Need New Name for A2DP Volume

Need New Name for A2DP Volume

Jelly Bean (Android 4.1 & 4.2) finally implemented what should have been there all along.  When you adjust the media volume with a Bluetooth device connected, it will remember this volume on the next connection.  It will also remember the volume before the connection and return to that upon disconnect.  This was the primary feature of A2DP Volume, hence the name.  Today A2DP Volume does much more.  Now that this primary feature is really not needed (and in fact will cause strange results with Jelly Bean) I need a new name for this app.  I posted an issue here: http://code.google.com/p/a2dpvolume/issues/detail?id=161.  Please share your thoughts on what I should call it.  In fact, I am thinking about adding more features aimed at removing driver distraction so the app will be more focused on that.  I am thinking something like "Eyes Free Driving", "Eyes on the Road", or maybe just "Drive". Would love to hear from others as naming things is not my strong point.

Jelly Bean Now Supported

I finally figured out how to access and use the hidden functions in Android 4.2.  I posted my approach here.  I created A2DP Connect2 and published it to the Play Store.  I also implemented this in A2DP Volume.  A2DP Volume is still missing the interface to access the user defined Bluetooth device name since both interfaces cannot exists in the same app.  My thought is that I will eventually retire A2DP Volume as we know it today replacing it with the app names above and it will be for 4.2 and up. 

Thursday, April 11, 2013

Finally making progress on Jelly Bean 4.2 Bluetooth interfaces

I finally purchased a Droid Bionic on eBay to use as my primary phone so I could put CM10.1 (Android 4.2.2) on the old Droid 3.  Last night I finally got the IBluetoothA2dp interface working with CM10.1, sort of.  I implemented what I have so far in A2DP Connect 1.0.14 (now available for download).  It does not work on the first try since the binder to the interface finishes after the call to use it.  I need to redo a bunch of things to fix that but at least I know how to use the interface now which is a huge step. 

It starts with this


Intent i = new Intent(IBluetoothA2dp.class.getName());
if (context.bindService(i, mConnection, Context.BIND_AUTO_CREATE)) {
return ibta2;


This calls mConnection:


public static ServiceConnection mConnection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
ibta2 = IBluetoothA2dp.Stub.asInterface(service);
}
@Override
public void onServiceDisconnected(ComponentName name) {
// TODO Auto-generated method stub
}
};


mConnection gets called when the service is connected or disconnected calling the functions within it.  The problem is that these calls happen after the ibta2 is needed.  So, the function I have in the code to get the ibta2 tries to use it before it is returned.  This stays bound though so the 2nd attempt worked because the prior attempt actually bound the service and kept it.

More work to do be done but significant progress.  It REALLY helps having a 4.2 device to test with.  Before that I was just guessing and hoping someone else would test.  I also did not have logcat to see what was going on.