Into the Mode
Our first application for the ListView control will be adding an image picker to Tagit. The purpose of the image picker is to show the images stored on the device and allow the user to pick which ones to upload and tag. ListView is perfect for this scenario since its ListViewGridLayout mode allows images to be aligned in rows and columns rather than in a vertical list.
After adding a picker page to Tagit and wiring up a ListView, we are rewarded with a thumbnail view of the images on the device:
Once images are selected, Tagit submits each image to Microsoft Cognitive Services Computer Vision API, which returns a JSON payload containing one or more captions generated for the image as well as a list of tags identifying attributes of the image. Tagit lets you know when each call is complete. Tagged images and the computer-generated captions created for them are displayed in another ListView control, this time using the conventional linear layout mode. Here's how it looks on Android:
Of course, ListView does an equally great job rendering on other platforms as well. Here's how it looks on Windows, where it conforms to UI guidelines for the Universal Windows Platform and is equally at home on a PC, tablet, phone, Xbox, or even a HoloLens:
So what exactly did the Computer Vision API do for us? Look at some of the information it returned, which includes information about the faces in the image complete with genders and ages, as well as objects in the image, colors, and even keywords for grouping images by category.