How to add viewfinder to google glass app - google-glass

I am currently trying to make a google glass application and am having trouble figuring out how to add a viewfinder to the CardBuilder for my application. Basically, I am trying to have a camera view along with displaying some data on the screen. I found some stuff online about using .addView() but this is not allowed with CardBuilder. Is there another way to do this?

Related

How can I use Google's Vision API on images in my own website

I am very new to Google's API and machine learning in general. I want to use the Vision API labeling ability for a student project I am working on.
I would like to create a website that works similarly to the demo of the API on google's product page. I would like to be able to click on images in the website and see the labels that vision creates. If possible, I would like to use a pre-trained model like the advertising material. Additionally, if possible, I would like to be able to sort the images based on their labels in the website's interface. I attached an image of what the demo on the product page produces for reference (the image is a digital render that I created). I want to see how well the API can classify artificially created images.
I have looked through a lot of the documentation but I am not really sure where to start with all this. I also found this on github, but I am not sure how to utilize something like this for my own images. Can anyone give me some pointers?
You can send image bytes, a path to a file in GCS or a path to a public image: https://cloud.google.com/vision/docs/reference/rpc/google.cloud.vision.v1#image
It sounds like you are interested in sending the image bytes.

How to download the multiple bokeh images as a single report

My application is hosted on Django and one of the html pages shows multiple bar graphs which are drawn using Bokeh. I know we can download each graph separately by using SaveTool icon which comes with Bokeh.
Now my requirement is I want to have a export button in the page, when I click on export button, all the images should be downloaded in a single pdf file or any other format what ever is the easier option to implement.
Please guide me how can I achieve this?
Thanks In Advance.
If this is a Bokeh server application, you could use the export_png function. However, it sounds like it is a Bokeh server application, in which case there is nothing built-in for this. It looks like there is a JavaScript API for screen capture. So you could try using that API in a CustomJS callback for a Button. Note that for security reasons that API will make make users provide active consent every time before allowing a screenshot to be taken.

Google Maps Embed without cookies

I'm currently using a Google Maps embed on my website like this.
It shows me the correct position as well as raitings, opening hours and so on.
The only problem I have is that it places some cookies which I am not allowed to use (EU law, it would require some specific informations I do not want to display).
I already read some threads where people advised to use Google Maps API V3 but I can't figure out how to display the exact same informations like icon, raiting.
Is there any way to remove those cookies using the iframe method?

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.

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

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.