0

I have an idea to open the Google Glass native application using GCM service.

Could anybody help me with this. Is that possible.

Alain
  • 6,044
  • 21
  • 27
Sanath
  • 493
  • 7
  • 22

2 Answers2

0

As of right now, there is no Google Play Services on Glass. Thus you can't register for GCM messages on Glass.

However, I do see GCMBroadcastReceiver in GlassHome's apk manifest, so I assume, they added (or in progress of adding) some pieces of Play Services. Will see what's gonna happen when they officially release Glass :)

Just to summarize, no, it is not possible to open native Glass app using GCM. At least right now

Pavel Dudka
  • 20,754
  • 7
  • 70
  • 83
  • Yes I understand the situation but this GlassBridge software dose that. See this http://www.geek.com/review/glassbridge-turns-android-apps-into-glass-apps-1562163/ – Sanath Oct 11 '13 at 09:17
  • Why do you think it uses GCM? As far as I can see - it uses the same Mirror API to communicate with Glass – Pavel Dudka Oct 11 '13 at 15:11
0

You can achieve the same thin using the Mirror API to insert a card that can then be used to launch a GDK app. Specifying a menu item as like below will insert a card with a menu that the user can tap to launch

"menuItems":[
      {
         "action":"OPEN_URI",
         "id":"OpenAppId",
         "payload":"my.package.name.scheme://open?param1=value1&param2=value2",
         "values":[
           {
             "displayName":"Accept",
             "iconUrl":"https://my_url_dot_com/glass_menu_icons/ic_done_50.png",
             "state":"DEFAULT"
           },
           {
             "displayName":"Accepting",
             "state":"PENDING"
           },
           {
             "displayName":"Accepted",
             "state":"CONFIRMED"
           }
         ]
      },

You'll need this intent filter on your Android manifest file:

 <intent-filter>
  <data android:scheme="my.package.name.scheme" />
  <action android:name="android.intent.action.VIEW" />
  <category android:name="android.intent.category.DEFAULT" />
 </intent-filter>

And can then access the query params passed in the payload as Intent extras.

Kevin
  • 11,521
  • 22
  • 81
  • 103
  • Thank you Kevin.Ihave solved that problem using same way you mentioned .http://stackoverflow.com/questions/20965155/opening-gdk-glassware-through-mirror-api-glassware-menuitem/20977865#20977865 – Sanath Feb 21 '14 at 03:10