What is the difference between Glass Mirror API and Google GDK? - google-glass

What is the difference between Glass Mirror API and Google GDK?
Google has announced the GDK here: https://developers.google.com/glass/gdk
but they haven't exposed any new features specific to Glass yet. How do we actually use the Google GDK?
Looking at the examples listed on the above link, we can create APKs, load APKs onto Glass and launch them using adb shell but is there a complete app or example anywhere?

The difference between the Mirror API and the forthcoming GDK boils down to where the application being written will run.
The Mirror API specifies how a web-based application will communicate with Google's servers to send updates to a user's Glass and how it will receive notifications when the user takes an action (such as a share, or a location change) that is directed at the Glassware.
The GDK is intended for applications that will run on Glass itself and have more low-level access to the sensors and to the underlying Android environment that Glass is built on top of. Google has not released the GDK yet - that page is where it will be released, and provides some early "getting started" concepts for developers who are interested in building native apps that run on Glass.

GDK has not been launched yet, so you cannot actually use it right now.
GDK will allow you to work directly on the Glass device using your Android development skills whereas Mirror API is a cloud/web-based API for interacting with a user's timeline only. See Prisoner's answer for more detail on this.
Because GDK has not been released yet, "complete" apps and examples do not exist. There are three samples (Compass, Level, and Stopwatch) listed on the link that you posted. The page says that these samples will eventually be updated into a "full Glass experience" when GDK is launched.
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

Glass Mirror API is for developing the Glassware(Pushing Webcards from server to Glass).
Google GDK(Glass Development KIT) is similar to current Android SDK, but they will have some special tool that will help develop Android Apps for google glass. Even now without GDK, developers are developing apps using Android SDK.

GDK will allow you to run apks on GLASS along with the GlassHome. GlassHome is the main display that you see within GLASS. If you install an APK without the GDK, the only way to get to it is using something like Launcher2.apk. With the GDK, and this is an assumption, your apk will be represented as a card within GlassHome.

Related

Install google glass app to android mobile

I'm developing app for google glass. I don't have glass, so i used to install file to android device. I referred this document Installing Google Glass in an Android Phone . But when i install and open my own custom voice trigger app, it won't open. I didn't see my app in list of voice command.
There are a few things to keep in mind.
First of all, those instructions were for a much older release of the Glass system. There have been many changes in how to launch a GDK app since then, and the most recent have been outlined in Why is my voice command missing from the ok glass menu in XE16?
Second, it is really difficult to appreciate the differences between Glass and more traditional Android devices. While you can probably get a basic understanding of development for Glass, you may have trouble understanding the UX differences. It is like trying to write for a mobile phone only by using a desktop computer.

Locate Glass's location on Google Map

Is it possible to have Glass do a POST on it's current coordinate to the server while running other apps, say, Google Hangout or take a picture?
Is there any example or APIs I can leverage?
If you are using Goggle Glass GDK, you can use an AsyncTask to to do work. If you are using Mirror-API, then that is a separate app, and it can work simultaneously (see GlassWare Fieldtrip).

Publishing Applications/Glasswares which are developed with GDK

How can we publish/distribute applications which are developed for Glass with GDK?
At submission form I don't see any APK file upload option. But I see a yes/no question(Does this Glassware use invocation voice commands?) which is a meaningful question for apps that are developed with GDK.
Am I missing something?
I just think that submission form is only for mirror api glasswares. Is that correct?
Google has not yet announced how you can distribute GDK Glassware on MyGlass. For now, hang tight.
The submission form you link is indeed only for Mirror API Glassware. More details about distributing GDK Glassware will be announced some time after the GDK graduates from its sneak peek release level into something more stable.
There are however multiple glass app sites. Here are 2 that I know of:
www.glass-apps.org
www.glassappz.com

Take a picture and share it with one voice command using Google Glass Mirror API

I just started using the Mirror API with a PHP web server. Is there anyway to integrate a voice command with my app that when said, Glass will take a picture and automatically share the picture with my server?
From what I read so far, it doesn't seem possible to access the camera with anything other than the default "Take picture" command. I also don't see a way to have Glass commit two actions (in this case take a picture and then share it) with one voice command. Is there any way to do the above with the Mirror API?
This isn't possible with the current features provided by the Mirror API. If this is a feature you're interested in using, file it in the official issue tracker.
However, you can implement this functionality with the GDK.

Location on Google Glass

Is it possible to get the user's location without using the Mirror API?
The hacking glass Google I/O video mentioned several android apis currently work and listed gps as one of them, however I have not had luck so far. I know Glass does not have GPS itself and must use the paired phones GPS. Would be awesome if we could use existing android location manager or newer Google play services location apis!
Yes, you can - if you use the GDK examples as a base and follow the Location Strategies (http://developer.android.com/guide/topics/location/strategies.html).
For a specific example, I just posted a hack of the GDK Compass sample in answer to another question that adds location updates pulled from the GPS (with or without a paired phone):
Can GPS for Glass be accessed through the Android SDK?
Google Glass does NOT have a GPS chip in it. I don't see why you could not have an apk that uses the LocationManager and add a listener to it that would print out the latitude and longitude in Logcat or even on GLASS itself. Now, to get that location to a remote user, that would require more work than not using the Mirror API.