I am hoping that you guys have read my previous blog where i explained the termonologies related to Glass. In this blog i’ll be explaining how to set up a project in Android Studio for Google Glass.
So before you start developing there are few perquisites to follow up. These are –
Make sure you have GDK installed, which you can install from SDK Manager. It is listed under API 15.
If you are using latest Android Studio, it means you are using gradle build system. In that case you need to change the following lines in your build.gradle –
compileSdkVersion "Google Inc.:Glass Development Kit Sneak Peek:15"
Or you can set all this while creating the project but sometime these settings do not take effect automatically in build.gradle file so beware for that and make sure these lines exist in your build.gradle.
If you want your app to look native to Glass then you should not be using any theme for your app as Glass take good care of that for you. So in order to make sure that your app doesn’t use using any theme, go to your AndroidManifest file and remove the android:theme line which is located under application tag. And just to be an extra careful check the activity tag as well, if there is any theme has been set there by default then remove it. But if you have to have a custom theme in your project, just create one in style.xml and extend it with Theme.DeviceDefault to make sure you don’t lose the native app feel of the Glass.
That’s all. You project has been set up now. In next blog we’ll learn about how to create static and live cards and add them to timeline.