GPS Library’s New Automatic OSS License Notice

This will save developers work and eliminate errors in the process.

Google Play Services now offers an automatic way to list the open source software an app uses. The app developer no longer has to maintain a separate list of libraries in a dialog.

Instead, the new GPS Open Source Software gradle plugin will gather info from each library for you. If you add a new OSS library, this plugin will automatically add it to the notice. It’s one less task to remember.

The actual UI displays each library’s name as an item in a ListView. This is what it looks like (as of version 11.2.0):

(Note that I set that activity’s title to a custom string.)

When the user clicks an item, it displays some detailed info for that library. In this version, the info appears to be just an http URL to the license’s main online text:

Questions are handled at StackOverflow.


Looking Forward to Final Release of Android Studio 3

Over three months ago, when the android team first announced Android Studio 3 , I installed it alongside Android Studio 2. But, after I ran into some mysterious bad behaviors, I decided to uninstall both versions. That solved the problem. But, I ultimately decided to reinstall only version 2 and wait for the stable 3.0 release to do a complete transition. I figured it would hit RC status pretty fast.

Today I noticed that the android team has withdrawn the beta 3 version..

Due to an issues with the Android Plugin for Gradle in Beta 3 (64527520), we’ve pulled it down and recommend that you not accept the update. If you already did, you can go back to Beta 2 by downloading here.

It looks like they have fixed a recurring bug in the upcoming beta 4 version. Hope that’s out soon. Still looking forward to all the nifty new features.


Quick Notes On Dockter’s 2015 BABBQ Talk on the Android Gradle Build System

Hans Dockter gave a talk about the Android Gradle build system at Big Android BBQ 2015(No bbq for me … saw it on youtube … woo hoo) 

Dockter addresses the issue of Android build performance in the last half of the talk. A few of my takeaways, for what they’re worth:

  • Android developers should try an upgrade to Gradle 2.8
  • Build times are slow mostly because of dexing and pre-dexing. There’s nothing Gradle can do to improve dexing time, per se.
  • Right now, a clean build deletes your pre-dexed libraries. So, they must be re pre-dexed each time. But, in the future, there will be an optimization where pre-dexed versions of libraries necessary to your project are cached resiliently. So, even if you clean your project, their dexed versions persist.
  • Future improvements in the Android toolchain or Gradle for Android will include incremental dexing and concurrent dexing.

Dockter also mentioned the possibility of caching pre-dexed libraries on a CI Server so they’d be available to all developers in the organization. (Or something like that.)

I wonder if teams that use a third party, CI server in the cloud will also be able to take advantage of this sort of optimization. 


Why I Try Not to Implement Parcelable

The short answer is: Parcelable implementations are overly complicated and brittle,  I’m bad at finding and fixing “Unmarshalling unknown type code” errors and I’m tired of being surprised by them.

There are hundreds of questions about Parcelable errors on StackOverflow. I’ve had my fill of trying to implement solutions (e.g. proguard configuration adjustments, read/write out of order, etc) and then hoping that the errors stop happening.

If my app runs in a single process and I want to pass some arbitrary custom object to an Activity or Fragment, I’ll create a singleton and store the object as a property on that singleton. Then my Activity or Fragment can get that custom object by calling a “get” method on the singleton. (Of course, it’s important to keep that singleton from holding on to excessive amounts of memory.)

Anyway, the official documentation apparently says we should avoid using Parcelable unless we have to pass an object instance to another process.

And, even in that case, there are questions about the performance gains attributed to Parcelable as compared to Serializable. 



Android Percentage Based Layouts

It looks like Android is now offering percentage based spacing in a new layout object.

I believe Cascading Style Sheets had specified that feature by 1998.


Saving State in a Compound Control

If you’re writing an android compound control and you want to save state between config changes, you may want to tell the Android SDK to butt out.

That is, you may want your compound control to be fully in charge of saving and restoring the states of its internal views.

Why would you want to do that – why not just let the Android SDK save and restore those interior view states?

Because in order to correctly save the states of those interior views, the Android SDK needs each of them to have unique ids.

And when does that become problematic?

When a client of your compound control puts multiple instances of it into a single one of their layouts. In this case, the interior views will all get the same ids or no ids at all. (Unless you want to deal with a certain amount of awkwardness in code.)

So, if, for example, your compound control consists of a LinearLayout which wraps some other stock views, it can be desirable for your LinearLayout to tell Android to simply avoid saving the states of those interior views. You can do this by calling dispatchFreezeSelfOnly and dispatchThawSelfOnly.

A helpful example of this is Charles Harley’s Lock Combination Picker on GitHub.

A discussion about how BaseSavedState should be used to save the state of your compound view is found in this StackOverflow question.


TextView Plus SeekBar

One way to couple a dynamically updating TextView with a SeekBar is to use a TextSeekBar.


Browzacado Is Dead

Sorry. The Google Play Store has informed me that my ad-free, free, non-profit avocado browser app for Android violated the terms and conditions of the store. They have suspended the app.

I meant neither to offend nor to exploit UC Riverside’s excellent avocado database. I only wanted to make it available in a more convenient format for mobile devices. I wish the fine team that created and maintains the UCR Avocado database all the best. I encourage anyone from that UCR team who is interested in having UCR take ownership of the app’s Android Studio project and source code to contact me to facilitate a transfer. Cheers.

Moving on …

View 1 Comment

Android Library for Reading Bluetooth Data from a Contec Pulse Oximeter

I’ve released an open source library for reading the real-time Bluetooth data stream from a Contec Medical Systems Pulse Oximeter (model CMS50FW).

The test and demo app can be compiled from the Github source or or downloaded from the Google Play Store.

View 4 Comments

CMS50FWLib Test App Privacy Policy

This privacy policy governs your use of the software application CMS50FWLib Test App (“Application”) for mobile devices that was created by Albert Braun. The Application is designed to test the CMS50FWLib open source library.

User Provided Information

The Application obtains the information you provide when you download and install the Application.

Automatically Collected Information

The Application collects certain information about the way you use the Application. But, it does not persist heart rate, oxygen level or other data generated by the CMS50FW pulse oximeter.

Does the Application collect precise real time location information of the device?

This Application does not collect precise information about the location of your mobile device.

Do third parties see and/or have access to information obtained by the Application?


What are my opt-out rights?

You can stop all collection of information by the Application easily by uninstalling the Application. You may use the standard uninstall processes as may be available as part of your mobile device or via the mobile application marketplace or network.

Data Retention Policy, Managing Your Information

The Application itself may retain User Provided data for as long as you use the Application and for a reasonable time thereafter. Please note that some or all of the User Provided Data may be required in order for the Application to function properly.


We do not use the Application to knowingly solicit data from or market to children under the age of 13 or anyone else.


We are concerned about safeguarding the confidentiality of your information. We provide physical, electronic, and procedural safeguards to protect information we process and maintain. For example, we limit access to this information to authorized employees and contractors who need to know that information in order to operate, develop or improve our Application. Please be aware that, although we endeavor to provide reasonable security for information we process and maintain, no security system can prevent all potential security breaches.


This Privacy Policy may be updated from time to time for any reason. We will notify you of any changes to our Privacy Policy by posting the new Privacy Policy at http://

Your Consent

By using the Application, you are consenting to our processing of your information as set forth in this Privacy Policy now and as amended by us. “Processing” means using cookies on a computer/hand held device or using or touching information in any way, including, but not limited to, collecting, storing, deleting, using, combining and disclosing information, all of which activities will take place in the United States. If you reside outside the United States your information will be transferred, processed and stored there under United States privacy standards.

Contact us

If you have any questions regarding privacy while using the Application, or have questions about our practices, please contact us via email at