Home > Brew gear, Tech geeks, Temperature monitoring > Android App Updated & Uploaded

Android App Updated & Uploaded

Screenshot_2014-09-28-13-46-09I tracked down the source of my Download % complete issue. Turns out it was an “order of precedence” issue. When calculating the % complete, I divided an integer value by a bigger integer value and multiplied by 100.0 – well, since the division operator occurred first, I was always getting 0 * 100.0. As soon as I changed the code to say 100.0 * downloadedTotal / totalFileSize – everything worked just fine.

I also made a small tweak to show sensors that had a downloaded data file but were not currently represented on the device as either a connected sensor or a remote (device) data file. The user can download a data file to the phone, then delete both the config and data file on the device. Before the tweak, the local data file wouldn’t show up at all – now it is displayed as “(local only)” in the list.


Screenshot_2014-09-27-16-41-22When looking around online I happened upon AChartEngine, a graphing library for Android that seemed relatively simple and powerful. I started thinking about how awesome it would be to quickly plot the data from my phone rather than pushing it to the PC, bringing it up in Excel, and plotting it within that application. As it turns out, it only took about an hour of fiddling (mostly formatting) to get a result I am very pleased with. As you can see from the screenshot, it will plot however much data is in the data file, and even breaks it into sections depending on the name the sensor has assigned to it at the time. This means you can easily and visually distinguish the various batches for a given sensor.

Because of the “(local only)” tweak I made, this also means that you don’t have to be connected to the device to display a sensor’s last downloaded data file. I don’t know how often that is going to be required, but I suppose at least when I am somewhere and want to explain the application to someone I could at least show the plotting capability.

The source code for my Android application has been uploaded to my OneDrive. It’s not perfect or pretty, but it gets the job done. I suspect I will end up writing more Android apps in the future, although I will likely do so in a different IDE – I really despise Eclipse. It crashes frequently, and is extremely temperamental.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: