In my app I have added custom menu items to user timeline items. So if user select the menu, a request supposed to send to server from glass. My question is how can I receive and parse this request in java servlet page? Here is my code for custom menu
// And custom actions
List<MenuValue> menuValues = new ArrayList<MenuValue>();
menuValues.add(new MenuValue().setIconUrl(WebUtil.buildUrl(req, "/static/images/drill.png")).setDisplayName("Found"));
menuItemList.add(new MenuItem().setValues(menuValues).setId("found").setAction("CUSTOM"));
timelineItem.setMenuItems(menuItemList);
timelineItem.setNotification(new NotificationConfig().setLevel("DEFAULT"));
At present am testing in development mode. To test this should I need to deploy my app or no need?
I using Java in server side. Any help would be appreciated.
Thanks.
You will need to have your Glassware on a server that is able to receive HTTPS connections from the public Internet. If you have it on a private server, or on a server without HTTPS, you will need to setup a tunnel.
To actually get the callback, you need to subscribe to the user's timeline using the subscriptions.insert endpoint. There is a sample Java method on that page which you can use to make the call. The URL you provide will need to be an HTTPS URL that Google's servers can reach and should resolve to a servlet that returns an OK status. See https://developers.google.com/glass/develop/mirror/contacts#subscribing_to_sharing_notifications for more about what your server needs to do.