Navigate to the timeline (to the card with bundleId) from within an application - google-glass

I have a Glass application that is activated by a voice command. The user requests a product and the request is then passed on to a node.js server, which handles the bulk logic of my application. When the node server is done, it builds some HTML templates that it passes on to the Mirror API, which then puts those cards into the timeline of the Glass app.
Now the problem I have is this:
When a user requests something from within the application, he just stays within that application but the cards from the Mirror API are put onto the timeline.
Is it possible to navigate the user from within the application to the timeline item that has just been inserted?
As I build the Mirror API timeline item, I know ahead of time what the bundleId will be on the timeline, so can I use that somehow to navigate to that item on the timeline?
I've had a look here on Stackoverflow, the Glass forums and the official documentation and couldn't see anything that would help.. Anybody here have any ideas?

Currently the only way for forcing a specific card to show in the timeline is by using a LiveCard (https://developers.google.com/glass/develop/gdk/reference/com/google/android/glass/timeline/LiveCard). Live cards will automatically be given focus when published and you can force the timeline to give your card focus after publishing by calling LiveCard.navigate().
So unfortunately unless you want to change some of the fundamentals of your app, this isn't going to be much help.
Though from the sounds of it, you may be able to use a LiveCard to show what is returned from your server. If you want to perform inserts via the mirror API, this could still be done in addition.

Related

How to measure the total amount of time my React Native app gets used

I am about to launch a beta version for my react native application, and I want to get information on how much time users stay on my app, and actually use it, how frequently they enter it etc. That would help giving me feedback. Also could be useful to know which pages get used the most. Is there such a thing that exists for that?
You may use analytics in your project. Google Firebase provides analytics. But I use Appcenter Analytics for my app. You can add custom events as well to track which page the user has opened or to find whether the button was clicked by user. Here is a screenshot from Appcenter dashboard.

Publishing Photo to Glass Timeline using GDK and NOT Mirror

I am working on a Google Glass application that will apply a filter and then take pictures. We used to use Card and TimelineManager to do this, but both were discontinued.
I'm currently using CardBuilder in replacement of Card, and I am able to take the photo and save it in Glass memory, but I would also like the photos to show up with the rest of the pictures taken outside my application (directly from Glass).
Most suggestions I found to publishing to Timeline require using Mirror. However, I don't want my application to require Internet access. Is there a way to publish to the Timeline without using Mirror?
I'm new to Glass and Android coding so any help will be appreciated :)
I've never tried TimelineManager before but I think Live cards is what you're looking for. It's used for publishing information to the timeline. No access to the internet required.
The doc has the sample code and some sample apps also use it.
Note: Static card is not supported by GDK as of now.
Hope this helps.
So there are two things. If you want the picture to appear to the left of the time (which would mean foreverish) then you want to use Live Card as suggested above. However, if you want to add it to the timeline (which is to the right of the time) then you can't add that via the GDK anymore.
Google felt that the Mirror API was built specifically for this and the Timeline Manager defeated the purpose of it so it was removed.

Add video to timeline from GDK or Add "Share" to live card

I'm using the GDK with XE16
I would like to save a video using MediaRecorder and then put it on the Timeline so I can let the user share the video to Gplus, YouTube or any contact. I am providing some additional information during the recording process as an overlay on the video preview.
I am able to save the videos into the /mnt/sdcard/Movies path. I am invoking the Intent.ACTION_MEDIA_SCANNER_SCAN_FILE to add the recorded video to the media database.
I have not been able to figure out how to add a share intent to on livecard. The previous API supported static cards, but those did not support video attachments; and the API is no longer available. I have also tried to use AccountManager and the com.google account in Glass to get an ouath token for the Mirror api to write direction via oauth2:https://www.googleapis.com/auth/glass.timeline. The authorization request shows up, but it is impossible for the user to accept the request.
I've considered sending the video file back to a proxy server that will then call mirror, but this seems like a big round trip for nothing.
I suppose I could send the credentials through this proxy, but this seems like a security nightmare.
The difference between Static Cards and a Timeline Item were large enough that the team, apparently, removed Static Cards until they could make the two of them work much more similarly. What you're trying to do is a commonly requested, and it does make sense that both should work mostly the same way.
You're on the right track for how to handle this at the moment - use the Mirror API to get it into the timeline as a Timeline Item. As you've noticed, you can't go through the auth flow since the user is unable to authenticate through Glass directly.
While you're testing, you can code in an auth token and a refresh token to be provided to the library to do this. For production through MyGlass, take a look at the auth flow that is available at https://developers.google.com/glass/develop/gdk/authentication

How to insert timeline card in new user account for first time

I've followed the Glass quick start guide for Glass for Python.
I'm able to run the server locally and can insert timeline cards to my account using the Admin Panel in Quick Starter. So far so good. But how the flow would look like for a new user? I'm creating a glassware similar to weather updates. In Quick starter, I had to trigger the "post" thru a "form" element. How does it work when someone installs Glassware from store. What triggers that person to get "very first" timeline card. I'm quite confused here. Any useful information will be helpful.
When a user turns on your Glassware in MyGlass, they will be redirected to your auth URL and taken through an OAuth flow (just as would happen if you visit that URL manually without going through MyGlass when you're developing). After they go through that authorization, you can perform any post-auth tasks that you need, such as inserting contacts or timeline items.
The relevant code in the Python Quick Start can be found in the _perform_post_auth_tasks method of the OAuth request handler, which is called at the end of the get request before redirecting to the Glassware's main page.

Facebook communication to Application

The start-up i currently work for is oriented around restaurant wait times. For our v1.25 specifications our clients -restaurants- that have Facebook pages want to be able to communicate to their app profile from their Facebook page.
The closest i have came to answering this question is the Graph API. However, the Graph API only allows us to read and write data to FB pages. So, is there a way for a restaurants FB page to write to its app profile? Secondly, Loso, whom we have modeled some of our designs from has this ability, does anyone have an idea as to how they have done it?
--Boris M.
Here is an option that you can consider...
When you are designing the app you can also develop a page tab to go with it...
You will find this option in the basic settings of the app.
You can make it to install for all first time users of your app, by getting a list of all his pages he created using that profile then install it on the one he selects.
This page tab when installed on a page will appears just where other tabs on the page appers(e.g. events, notes etc. occurs)
You can provide your required functionality on this tab as you like.
Thus the user can just select that tab on the page and use its functionality to post on the profile page of the app.
Hope this works for you... and also u can check out the jobcaster app it does something like that!