4

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!

Patrick Jackson
  • 18,766
  • 22
  • 81
  • 141

2 Answers2

1

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?

Community
  • 1
  • 1
Bill
  • 211
  • 1
  • 2
  • 7
0

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.

Clocker
  • 1,316
  • 2
  • 19
  • 29
  • 1
    Google Glass does not have a inbuilt gps. – Amalan Dhananjayan Oct 04 '13 at 03:22
  • Because It does not have a GPS chip, you cannot use location manager at all. – Amalan Dhananjayan Oct 04 '13 at 04:41
  • 1
    That is incorrect. I have successfully had Glass send messages to a remote server with its latitude and longitude with the use of Location Manager and a LocationListener. Glass is Android... – Clocker Oct 04 '13 at 17:30
  • Yah you may be right but, it needs your phone to be paired with it. And can you please post you code snippet. – Amalan Dhananjayan Oct 05 '13 at 05:42
  • 1
    Glass might also get the location based on the WiFi connection. The code works exactly like it does in Android. I had an android app that incorporated the location listener and I installed it on Glass. I ran the app and it worked like a charm. – Clocker Oct 06 '13 at 16:28