13

Today Google just released the GDK Sneak Peak for Google Glass. I have tried to run the samples they have hosted in GitHub with no success:

I am targetting against Android 4.0.3 Glass Development Kit Sneaky Preview and trying to run it in an AVD that also targets it with the following other specs:

  • 640x360 hdpi
  • For the CPU I tried both ARM & Intel Atom

When I run the app and the dialog to choose the device is shown I do see the virtual device as non compatible.

enter image description here

If I skip it and try to run it I see the following error output:

Installing com.google.android.glass.sample.compass
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.google.android.glass.sample.compass"
pkg: /data/local/tmp/com.google.android.glass.sample.compass
Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY]

I have tried to force not to require the glass library (setting the requirement to false) in the AndroidManifest.xml:

<uses-library
    android:name="com.google.android.glass"
    android:required="false" />

... but obviously doesn't run properly, it's being shown in kind of an overlay:

enter image description here

I have also tried using Genymotion, but it doesn't run either.

Is there any way to run successfully glassware in an emulator?

EDIT:

Adding the gdk.jar as a library doesn't work.

atxe
  • 4,825
  • 2
  • 33
  • 48
  • Good question. If you were success on this, please drop a comment/answer here as well - http://stackoverflow.com/questions/20112673/google-glass-when-will-be-the-gdk-emulator-get-released?noredirect=1#comment29970299_20112673 – PeakGen Nov 21 '13 at 04:49

1 Answers1

2

Only a small percentage of the sample code seems to be using the GDK libraries. For example, the Compass example has a CompassService that is in charge of attaching the CompassRenderer into the Glass Live Card. It also has a CompassMenuActivity, that basically has calls to standard Android menu rendering. Those could be called a "glue" that wrap the compass-functionality into the Glass experience. Major parts of the compass code are just standard Android libraries.

Assuming that the emulator currently does not have a way to run glass libraries (and no-one has hacked them into it yet), and if you want to run the Compass example without actual Glass hardware, you need to implement the Service & MenuActivity in your own "standard Android" way. Basically, create an activity that implements the CompassRenderer in a surfaceview.

Have a look at these commits for an example (tested on Galaxy S4, views are being rendered and menu items are functional):

https://github.com/blaind/gdk-stopwatch-sample/commit/26e9801af983b9fc931d6dfe5ce1fcb80766fd10 https://github.com/blaind/gdk-compass-sample/commit/0d89e922a167c0fac6890684c514b9028e7bfea8

Mika Vatanen
  • 2,749
  • 1
  • 19
  • 26
  • Good point :-) I would add that live cards are quite similar to widgets. Wondering how much time would take to build something with dependency injection to rely on non-glass classes^^ As it seems that at the moment there is not a hacked emulator, I accept the answer ;) Thanks! – atxe Nov 24 '13 at 20:38