Product
May 17, 2024

Continuous improvements over-the-air with Viam for Android

Written by
Matt Vella
Developer Relations

We are nearing almost 4 billion active Android devices in the world, a number that is ramping up to over a billion additional devices being added per year. From phones to tablets, vehicles to retail, these devices are ubiquitous and are relied upon by most of us on a daily basis. Typically, capabilities are either custom-built for a single purpose device (like a point-of-sale kiosk), or managed via app store installation (for end-consumer devices). In both cases, a human would update the software (Android APKs) through a manual process, which can be labor intensive and lead to scheduled maintenance windows.

Viam server running on Android devices breaks that paradigm - new capabilities can now be added and managed over-the-air.

Let me paint a scenario. I have an Android-based retail device that uses machine learning models to identify buying patterns in order to make custom recommendations to shoppers. The machine learning models are being iteratively improved as more data is collected.  Perhaps the efficiency of these models is also being improved - so initially these models are running in the cloud, but later are moved on-device. Normally, one would need to create new versions of their Android application and deploy this new application to each Android device.

Updates to all devices rolled out smoothly and securely with one central action

With Viam, updating ML models and even updating where these models are running can be accomplished with no code changes and no app updates. One can instead change the device configuration for the fleet through a secure web-based administrative interface and deploy the changes over the air. So from one day to the next, the retail device can become more effective without any in-person human intervention.

Beyond the iteration of existing capabilities, new capabilities can also be added remotely. Let’s say we now want the retail device to be able to handle sales directly -  the devices now need to be able to plug into physical receipt printers near the store exit. A viam module that contains the logic and API to interface with this printer would be configured centrally in the Viam cloud app by an administrator and rolled out to all devices. If a wireless receipt printer were installed later on, no code changes would be required to the Android app, as the same standard API for receipt printing would be used.

The Viam platform has a number of built-in capabilities, but engineers can create their own modules to extend this functionality. For example, I was recently using an Android tablet to manage the security of an entryway. In order to lock and unlock, I selected a Numato USB relay, which allows Android devices to directly control a lock through serial commands. Reading the Numato documentation and using an Android library that brokers serial commands over USB I was able to create a module using the Viam Java SDK, then deploy it to the registry making it available for use. Now unlocking a door is a single line of code:

await relay.do_command({'on': 1})

Moreover, adding this capability to any Android device running Viam is simply a matter of selecting this module from a drop-down menu.

Over-the-air updates for interoperability and iterative improvements allow Android-based product lifecycles to be accelerated. With billions of Android devices out there, that’s a lot of speed. Want to add Viam to your Android product? Learn more about the benefits here.

on this page

Get started with Viam today!