New Android APIs Track Human Faces, Connect Nearby Devices

Google announced new APIs as part of a Google Play services upgrade that identify and track human faces in photos or video and connect to nearby mobile devices, along with enhancements for Google Cloud Messaging.

The APIs are part of the Google Play services 7.8 upgrade. "The Nearby Messages API allows you to build simple interactions between nearby devices and people, while the Mobile Vision API helps you create apps that make sense of the visual world, using real-time on-device vision technology," developer advocate Magnus Hyttsten said in a blog post last week.

The new features are available to developers in the Google Play services SDK, which can be downloaded from the Android SDK Manager, a tool available in the Android Studio IDE.

Hyttsten said the Mobile Vision API used to track faces improves upon the company's existing Android FaceDetector.Face API. "It finds faces in any orientation, allows developers to find landmarks such as the eyes, nose, and mouth, and identifies faces that are smiling and/or have their eyes open," he said. "Applications include photography, games and hands-free UIs." An accompanying Barcode API does much the same for barcodes, working in real time in any device orientation.

Detecting Human Faces and Measuring Smiles
[Click on image for larger view.] Detecting Human Faces and Measuring Smiles (source: Google)

In addition to Android, the Nearby Messages API also works with iOS apps, Hyttsten said. "Nearby Messages introduces a cross-platform API to find and communicate with mobile devices and beacons, based on proximity. Nearby uses a combination of Bluetooth, Wi-Fi and an ultrasonic audio modem to connect devices."

The company also announced enhancements to Google Cloud Messaging, adding notification support for localization on Android. "When composing the notification from the server, set the appropriate body_loc_key, body_loc_args, title_loc_key, and title_loc_args," Hyttsten said. "GCM will handle displaying the notification based on current device locale, which saves you having to figure out which messages to display on which devices!"

About the Author

David Ramel is an editor and writer for Converge360.