



What is an immersion?

Once started an immersion takes full control of the screen.

Project setup

Set minSdkVersion and targetSdkVersion to 15 (Android 4.0.3)

and to 15 (Android 4.0.3) Set compileSdkVersion to "Google Inc.:Glass Development Kit Sneak Peek:15"

to Do not assign a theme to your application or derive your own theme from Theme.DeviceDefault





Creating the immersion

Launching the Glassware - Voice commands

The final Glassware

This article describes how to create a simple hello world application for Google Glass using the Glass Development Kit (GDK). As described in the previous article you have two options how your Glassware should show up on the device: As athat is part of the timeline or as anthat is displayed outside of the context of the timeline. This article focuses on how to write an immersion.An immersion is basically an Android activity. The name immersion implies that it is not part of the normal Glass timeline. Instead it takes full control of the device - except for the back gesture (Swipe down). To go back to the timeline you need to leave the immersion.Create a normal Android project with the following settings:Let's create a simple activity. The Card class helps us to create a layout that looks like a timeline card.After creating the activity we need a way to start our Glassware. A common way to launch Glassware is to use a voice trigger. Let's add a simple voice trigger to start ouractivity.First we need to declare a string resource for our voice command.The next step is to create an XML resource file for the voice trigger using the previously created string value.Now we can add an intent filter for the VOICE_TRIGGER action to our activity. A meta-data tag links it to the XML file we wrote above.The developer guide requires you to add an icon for the touch menu to the activity (white in color on transparent background, 50x50 pixels). The Glass Asset Studio is a helpful tool to generate these icons.Now we can start our Glassware by saying "":Another option to start our Glassware is to use the touch menu and scroll to the "" command:The source code for this Hello World Glassware is available on GitHub