Google Glass SDK/Mirror API and Glassware

We are actively working on a Glass Development Kit (GDK) that allows you to build Glassware in the form of APKs. We’re still hard at work on the GDK, but in the meantime, you can start designing and developing your awesome ideas with the existing Android SDK. Although you won’t have all the tools necessary to design the perfect experience for Glass, developing with the Android SDK lets you try out ideas while you wait for the GDK.

Glass is built on the Android 4.0.4 platform, so you can write APKs using the standard Android SDK (API Level 15) and sideload them onto Glass. The Android SDK provides you with a wide range of APIs to do things such as access the low-level hardware, render OpenGL, use stock Android UI widgets, and much more. You can even use the Android NDK to develop.

We encourage you to start developing APKs for Glass and experiment with what you can do. For more information on utilizing the Android platform and if you're adventurous, gaining root shell access, see the Void Your Warranty Google I/O session video.

Samples

All of our APK samples are available on GitHub and we will be adding more. When we launch the GDK, we'll also update these samples to show the migration path from a traditional Android app to a full Glass experience. Make sure to check regularly for updates:

CompassLevelStopwatch

PrerequisitesA good understanding of Android development. See the 

Android developer training site for information on how to get started. Because Glass is built on the Android platform, you can use many Android resources that are already published for help.Android SDK - This is needed for development.Glass - You can push the code to an Android device or emulator but to design a real Glass experience, you need the actual device.

Importing and compiling the samples

Checkout the samples onto your filesystem and use your favorite IDE to import and compile the code.

In Eclipse and ADTClick 

File > Import ... > Existing Android Code into Workspace.Click **Browse**, select the location of the apk-[sampleName]-sample/ directory, and click **OK**.Select the **apk-[sampleName]-sample** project to import it and select **Copy projects into workspace**.Click **Finish** to complete the import.

In Android StudioCheckout the sample to a location where you keep your Android development projects. A apk-[sampleName]-sample/ directory is created.Click 

File > Import Project ..., select the location of the apk-[sampleName]-sample/ directory, and click **Next** until you see the **Finish** button.Click **Finish** to complete the import.

Turning on debug mode

You'll need to turn on debug mode before you do any type of development on Glass. Go to **Settings > Device Info > Turn on debug** to enable it.


Running the APK on Glass

You can use your IDE to compile, install, and run the APK or use adb on the command line:
$ adb install -r [sampleName].apk

$ adb shell am start -n com.google.glass.samples.<sampleName>/.<MainActivityName>

1
**Note:** The Glass screen must be on when you run the APK.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值