It’s the day after the day after Christmas day, which is traditionally DevOps day here in Wellington. In a tradition that stretches back at least 30 seconds when I made it up, today is the day to sort out some of the build and deployment issues that you’re experiencing with the project you rushed to market without considering all the technical debt you accrued.

Hosting Things Drivers on Bintray and JCenter

Nobody wants to clone a repo and set up a module in Android Studio these days. All the cool kids make it easy for people to start using their libraries, so who am I to do things differently. This is the first time I’ve hosted anything on Bintray so I needed some help from the Internet. After reading a few tutorials two stood out. IntheCheeseFactory and this other one helped a lot, and after a bit of reading, snacking, thinking, and experimenting I got everything set up.

Changes

To make life easier I’ve moved the repository from Bitbucket to Github. I’ve got nothing against Bitbucket, I use it at work and like it, but the Bintray-Github integration seems better, with Bintray able to pull READMEs and changelogs from Github automatically. It may be possible to do this with Bitbucket but all the examples I found use Github and well, why make things harder than they need be just to satisfy my contrarian tendencies.

The driver source code repository is now here

Using the driver is now a matter of adding the following to your gradle dependencies

compile 'nz.geek.android.things:things-drivers:0.1.1'

That’s it, job done. Now to use the driver create an lcd using the builder and write to it.

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    I2cSerialCharLcd.I2cSerialCharLcdBuilder builder = I2cSerialCharLcd.builder(20, 4);
    builder.rs(0).rw(1).e(2).bl(3).data(4, 5, 6, 7).address(6);
    I2cSerialCharLcd lcd = builder.build();
    lcd.connect();
    lcd.print(1, "Hello World!");
    lcd.print(2, "from JCenter!");
  }

 

The Result

Well Hello there