/ programming

fitbit4j - java fitbit api client in maven repository

fitbit4j is a fully working java API client library for the fitbit-API. I currently started working on a project that I intent to integrate with fitbit through their API, and quickly discovered a problem. The official fitbit4j api library is not available in maven. However, fitbit pushed their maven releases to github, which sort of works but is quite nasty. Unfortunately the latest version that they published in such a way was 1.0.25 which is broken.

Some time after fitbit published this version they changed their API to enforce SSL, which is a good thing. However, this broke version 1.0.25 of fitbit4j. They pushed code for version 1.0.26-SNAPSHOT to their public github repository, but did not release it in their "maven repository" on github. So the only solution, until now, if you wanted to use fitbit4j in your projects was to build it yourself and install it to your local maven cache. This is not a good solution. I loathe having artifacts installed to a local maven repository as this makes distributed work a pain and involves a manual checkout process, or potentially a scripted checkout process.

Since I loathe using local maven I naturally have my own maven repository running. I therefore decided to fork fitbit4j on github, change the publication setup and publish 1.0.26 as a release to my own fitbit maven repository. Now, since I have this repository online, I'll also share it to the world, so you too can avoid installing fitbit4j in your local maven cache, and rather use a proper repository.

Article continues after ad

The forked project is available at https://github.com/deadcyclo/fitbit4j

The maven repository is available at https://nexus.vanntett.net/content/repositories/fitbit/

Feel free to use this repository as much as you like. fitbit4j seems to have been abandoned after version 1.0.26, or possibly their API simply is very mature. If fitbit pushes updates to fitbit4j, I will sync them to the fork and publish new versions to the maven repository. This is not a true fork, hence I am not intending to maintain the project myself, other than syncing anything fitbit does, and naturally since I rely on the API-client myself, I will fix the client myself if it in the future breaks without a fix from fitbit themselves. I am not planning on adding any new features to the project. However, if you want to contribute any changes of fixes you might have implemented, feel free to submit a pull request and I'll include them after a code review (If this does happen, I will maintain a set of maven repositories, one for the official version and one for the version containing 3rd party contributions.

I also have a heads up if you plan on using fitbit4j to investigate the fitbit API: don't. fitbit4j is fairly large and messy, written in your typical enterprise bloated way, and not very well commented. If you want to use an API library to investigate their API, you are probably much better off having a look at this third party python api library. It is fairly small, tidy and well commented.

Photo by Andres Urena / Unsplash