Leveraging a mobile backend-as-a-service (BaaS) or mobile application server to power your mobile apps has many advantages. Chief among them is the flexibility to support the proliferation of new devices, including the burgeoning number of devices that fall into the “wearable computing” category.
In the spirit of innovation, Will Harmon, one of the developers on the AnyPresence team, recently built a cool prototype app (named HelloGlass) for Google Glass using an unmodified AnyPresence Android SDK. It is a straightforward app that enables display of data via the Glass display and editing of data via voice and touch gestures, against a cloud-based MongoDB instance powered by an AnyPresence backend application server.
Below is a quick overview of the project, and some screenshots for your viewing enjoyment.
- HelloGlass uses a standard Android Activity, compiled with the GDK (Glass Developer Kit), to display a list of cards fetched from the server and to send spoken text back up.
- After dropping the AnyPresence SDK into the project, a call to Contact.queryInBackground grabs all contacts from the server. In the callback, a list of Cards are created and passed to the CardScrollView.
- Spoken text is captured using startActivityForResult(new Intent(RecognizerIntent.ACTIONRECOGNIZESPEECH), SPEECH_REQUEST); and passed to the server with a call to mActiveContact.saveInBackground
In layman’s terms, after creating a “Contact” object in the AnyPresence designer, an Android SDK was compiled and imported into a Glass project. One line of code in the SDK grabs all the Contacts from the server, and with a simple tap on the Google Glasses, the user can then use voice commands to view, edit, update, delete or call a particular contact.
The project illustrates how easily MBaaS technologies like AnyPresence support new devices such as wearables.