NutriLens 2

NutriLens 2.0 is now out on the Play Store. Completely rebuilt from the ground up and much easier to use this update includes:

  • New friendlier design
  • No AR nonsense, just take a photo of food packaging or pick from one from your gallery
  • No choosing from the different table/lozenge nutritional info types, NutriLens now knows which is which
  • Crop photos after taking them
  • Edit the macro nutrient amounts if Nutrilens can’t read them
  • Dark mode support
  • Rewritten in Kotlin (previous versions were Java)


android nutrilens

NutriLens in action

I made a quick video demo of NutriLens and uploaded it to YouTube. Enjoy!

NutriLens is available in the UK & Ireland on the Google Play Store for Android 6.0+.

android nutrilens

Why I made NutriLens

A few years ago I was creating an Android app that used a popular UK supermarket’s public API (no prizes for guessing which company) to retrieve nutritional information about food products. The whole idea of the app was to use the traffic light system to give shoppers a better idea of which products were truly healthy. One day I was testing the app and noticed that the product information was there but not the nutritional data. I posted to the API forums about this and somebody replied and said they were looking into it. Then the thread mysteriously disappeared. The nutritional data never came back. I have no idea why this happened but I can guess. I thought all of my efforts had been wasted and I would have to stop developing the app.

Then I had the idea of using OCR (Optical Character Recognition) and the device’s camera to read the text on the food packaging, parse it, validate it, perform some simple mathematics and display the traffic light nutritional info. NutriLens was born and it had the advantage of not being dependent on a third party API that might change or be decommissioned. It was still a difficult app to develop. If the device moves or tilts all the position information for the text changes and sometimes it assigns the incorrect amounts to the macro nutrients. This is especially true of the table on the back of good packaging as there is a lot of information. However, with some regular expressions and heuristics it does a pretty good job.

A lot of people think that this sort of thing is not needed because its obvious which are the healthy foods and which aren’t. It’s really not. Companies use branding and packaging to make products look healthier than they are. For example, low fat yogurt can contain a lot of sugar, cereals with sporty branding contain sugar and words like “Natural”, “Organic” and “Protein” are used to distract consumers from the real nutritional data. More insidious is the way companies use neutral coloured lozenges on the front of packaging. Take this photo of the packaging from a healthy looking granola bar:

It looks pretty healthy. Elsewhere on the packaging there are some of those words I mentioned above. Somebody might choose this product instead something stereo typically unhealthy like a chocolate bar. But look at what NutriLens makes of the those numbers:

It’s red on fat and saturated fat and orange on sugar and salt! None of the nutrients have a green traffic light. This is why NutriLens exists. It’s still up to the consumer to decide to buy the product or not but they can do so with a little more knowledge than before. Something with these traffic lights should only be eaten occasionally as a treat. I realise its a niche app and it’s not going to take over the world but at least it can provide some clarity and hopefully highlight the tricks the food industry use to sell their products. NutriLens is available in the Google Play Store for Android 6.0+ devices in the UK.


SMS Bot Widget is no more

After over 8 years in the Play Store SMS Bot Widget has had to be taken down. Google has updated some policies on apps that have the permission to write SMS messages. Basically any app with this permission has to be a fully fledged SMS sender/receiver app. SMS Bot Widget was never intended to be that so it has to go. It wasn’t the most popular app but over its lifetime it had an average rating of 3.86 stars which I think is pretty good. If I get round to it I might release the source code on github so that it’s spirit can live on!

android nutrilens

NutriLens Beta in the Play Store

I just uploaded a new app to the Google Play Store. It’s called NutriLens. It scans nutritional information on food packaging to show you how healthy it is. Sometimes food packaging can be hard to understand or even deceptive. The UK Government put together some guidelines but these are not mandatory. Where packaging does not use the traffic light system NutriLens can read the text on the packaging using the device’s camera and Optical Character Recognition (OCR). After parsing this information the app displays the nutritional information as it should be with red, amber or green for fat, saturates, sugar and salt like this:

It’s only available in the UK and Ireland for now. Android 6.0+ required.
More info here
Play Store Link here


New website hosting

I have moved hosting providers. The upshot of this is ubikapps now has a wonderful and free SSL certificate from those lovely people at Let’s Encrypt. This means you can use this site with HTTPS (the S stands for secure!) Let’s make the web secure by default! Let’s Encrypt! You also get to browse this site using HTTP 2 instead of the old two tin cans and a piece of string HTTP 1.1. It’s much faster, stronger and better (if your browser supports it, try Chrome).


SMS Bot Widget V2.60 released

I have just released SMS Bot Widget version 2.60 to the Google Play Store. This release includes:

  • Privacy policy link
  • New theme
  • Only Android 2.3+ supported (Android 1.5-2.2 support dropped)
  • Widget count reduced to one resizeable version on Android 3.1+
  • Improved widget loading on reboot

Dropping support for the ancient Android versions let me remove a lot of legacy code from the app, simplifying it. I think Android 2.3 is a very reasonable minimum in 2017! I also realised that having 3 different widget versions for Android 3.1+ was redundant. Having one resizeable widget simplifies things. However, existing 1×1 and 2×1 widgets already on home screens will need to be re-created.



SMS Bot Widget Privacy Policy

I have created a privacy policy for SMS Bot Widget here. As the app uses contacts and phone state permissions Google requires that there is a privacy policy available in the Play Store and the app itself. I have updated the Play Store listing today and will issue an app update soon.


Keeping a water damaged Moto 360 limping along

I still use my Moto 360 (the first and best version because of the lugless design). It’s great for never missing notifications when my phone isn’t right next to me, setting reminders and controlling music. I keep my phone on silent so sometimes its easy to miss texts and calls. A while ago I took it swimming with me and it started acting strangely. It’s rating is IP67 (dust tight and water-resistant for up to thirty minutes in 1 meter of water) but it started to behave as if it was charging all the time. This means the screen was on permanently no matter what settings were used (cinema mode, raise to wake and ambient mode). This drained the battery really quickly so the watch became useless. After trying all the usual tricks like putting it in rice, in a cupboard with a dehumidifier and putting it in rice in a cupboard with a dehumidifier it still thought it was always charging. After searching for fixes I found that because it has Android 6.0 it’s possible to send an adb command to it that simulates unplugging the charger:

adb shell dumpsys battery unplug

This command is for testing things like doze mode whilst still being attached to a computer fro debugging. This finally made the Moto 360 turn its screen off, preserving the battery and making it viable again. Unfortunately there are some drawbacks:

  1. It doesn’t obey the raise to wake setting. The screen has to be touched before it turns on
  2. The battery level is not reported correctly in the pull down menu
  3. The little lightning charging indicator is still permanently displayed

To get around drawback number 2 I made a simple watch face that uses the battery level API in Android to show the correct battery level. The source code is in github.



mARsquerade Non-cardboard mode added

I have added a monocular branch to the mARsquerade project in github. It allows the app to be used without Google Cardboard i.e. like a camera app. There is take picture button which saves images to /sdcard/Pictures/mARsquerade but it doesn’t save the masks on top of the photos yet and there is no gallery built into the app. I’ve got these features on my to do list. When the app first starts it asks if you want to use Cardboard or not. The monocular mode can only be used in landscape for now.