Sunday, June 16, 2019

A2DP Connect going away as separate app

A2DP Connect (a.k.a. A2DP Connect2) is being replaced with widget integration into A2DP Volume.  In order to make the widget icon change based on connection state I needed to track the connection state of Bluetooth devices.  A2DP Volume already does this.  Rather than have another background service, and now the required notification icons, I instead integrated the A2DP Connect widget into A2DP Volume.  Now A2DP Volume has 2 widgets.

The one on the left (showing a car) is the old location widget and that works as it always has.  The widget on the right is the connect widget.  It works just like it did in A2DP Connect.  This change happened in A2DP Volume 2.12.12.5.  

Saturday, February 23, 2019

Working on A2DP Connect2

I finally got around to dusting off the aging A2DP Connect2 widget and getting it updated to work on newer devices better.  I have not yet pushed an update to the Play Store but I am putting signed APKs as I progress here.  I also have the Github page for it here.  I have it compiled for API 19 through the current API 28 (Pie).  I cannot test it in emulators though so I have only tested on Android 7 and Android 8 right now.

The most requested issue, which is posted on the issues list, is to have an indication of the connection state.  I have that somewhat working.  I say somewhat since there is not an interface to get this.  In Android you are supposed to use a background process to listen for Bluetooth connection changes.  These are called Broadcast receivers.  You register your receiver with filters to call back to your service when the connection changes.  In the response, it will tell you details such as profiles that connected and of course the current connection state.  This is how A2DP Volume does it.  There is another back door approach that involves using reflection to access methods that are not exposed.  To do that you must bind to a service that accesses an IADL.  A2DP Volume and A2DP Connect2 use this to make the connect/disconnect happen.  It's tricky and undocumented, and risky as they can change Android and break this with no warning. This happened back when Jelly Bean came out and the Bluetooth stack was replaced.  I have made several attempts at using this method to get connection state but there are incompatibilities between widgets and binding services that I have not yet been successful. 

Update: After hours of trying and failing, it finally seems to work.  Opt in to the beta testers to get the test apk: https://play.google.com/apps/testing/a2dp.connect2Let me know your feedback.

Update 3/9/2019: In order to make the icon change based on connection state, I needed to have a foreground service running which means having a notification icon active.  I thought that was too much for a simple widget.  So, I added a simple call from A2DP Volume (which already has the service running) to run an update service in A2DP Connect2 and update the icon when the state of the Bluetooth connection changes.  This will be in version 2.12.12.5 of A2DP Volume. 

Friday, February 8, 2019

Recent updates to A2DP Volume

I have been busy this winter finally getting around to fixing a bunch of broken stuff on A2DP Volume and making changes required to comply with Play Store policy changes.  You can see the log of updates on Github.  Here are some highlights:


  • Removed a bunch of really old and unusable Pandora integration.
  • Fixed the custom intent maker to actually work
  • Fixed many issues around registering and unregistering broadcast receivers.  This was the root cause of the notification reader reading messages twice.  I also added a simple check to prevent the same message from being read twice.
  • Fixed the media playback when using voice call stream.  It works on Spotify now but not necessarily all players.  
  • Updated the minimum SDK (Android version) to 23 (or Android 6.0) and the target SDK to 28 (Android 9.0).  This is far more work than it sounds as this requires many things to be re-implemented as older methods are deprecated.  Play Store now requires the target SDK be 26 or higher.
  • Many additional robustness improvements.
  • Added many log file entries so people can use LogCat and see what is going on.
  • Removed the SMS reader to comply with new Play Store policy.  Now you have to use the notification reader to read SMS messages.  This also removed a bunch of permissions including not just SMS but also contacts access.  
  • Added a shortcut from the preferences menu to set up your notifications and removed the internal app preferences for notifications.  Basically Android now gives the user much more control over notifications so now you just use the configurations in Android for this.  I added a wiki about this here.
  • I removed the ability for A2DP Volume to set the media volume in Android 9 and up since Android 9 already has this built in to the OS.  However, I got bad reviews and complaints about removing it so I added it back but made the default to not set media volume.  It really is no longer needed and it may actually fight with the OS if you use it but I guess folks will need to learn that themselves.  It is interesting that it took until Android 9 to finally implement this, making the feature this app was named for obsolete. Now I really should change the name.
  • I made many improvements to the way the media volume before a device connects is captured.  This ensures that an adjusted media volume is not captured instead.  
  • I added an additional check to open the notification access permissions settings in Android so users can enable A2DP Volume notification access to make it work.  This was not very obvious and nobody seems to read the manuals so I hope this helps.  Many bad reviews claiming the reader did not work.



Sunday, August 26, 2018

Android 9 (Pie) makes A2DP Volume original feature obselete

I presumed this would happen from the beginning but it sure took a long time.  Android 9 finally has a feature to remember last used volume from connected Bluetooth devices.  This means you no longer need A2DP Volume to manage the media volume for you (its original and primary feature).  In fact, if you have Android 9 do not use the A2DP Volume media volume adjustment feature as it will fight with Android 9's own feature for this same purpose. 

At this point A2DP Volume is an maintenance mode.  I plan no new features for it and I expect over time it will quietly disappear as people get Android 9 and above. 

Saturday, January 21, 2017

Handling Android 6.0 permissions

I finally got around to handling the new Android 6.0 permissions properly.  A2DP Volume requires many permissions which are explained here: https://github.com/jroal/a2dpvolume/wiki/Permissions-Explanation.  Android 6 brings a new way to allow the users line item veto, at least to some degree which is explained here: https://developer.android.com/guide/topics/permissions/index.html.  If you are on A2DP Volume version 2.12.8 or older, and you first installed A2DP Volume on a device with Android 6 or higher then you may run into problems with features not working or even app crashing.  The temporary fix for this is to go to Android settings -> apps and select A2DP Volume.  Then click the "permissions" button and enable all permissions.  A2DP Volume 2.12.9 will fix this by explaining and requesting permissions when you first open the app.  

Tuesday, June 16, 2015

All projects moved to GitHub

Since Google is closing their developer website I had to export all projects to GitHub.  Here are the new homes:

A2DP Volume: https://github.com/jroal/a2dpvolume

A2DP Connect: https://github.com/jroal/a2dp-connect

A2DP Connect2: https://github.com/jroal/a2dp-connect2

You can see all my GitHub projects here: https://github.com/jroal

I will stop using the google code pages immediately.  All activity will move to GitHub.

Sunday, May 10, 2015

Android apps

Lately I have been busy and have not done anything with my Android apps. I am thinking I have lost interest. When I look at the reviews and the issues list it now feels more like work than fun. I did move it to github now since the Google developer site is going away. Today I made the required updates to the app ratings per play store requirements. It's surprising how much maintenance is required even when you aren't working on the app.