Programming Google Glass: Build Great Glassware Apps with the Mirror API and GDK (2nd Edition)

Programming Google Glass: Build Great Glassware Apps with the Mirror API and GDK (2nd Edition)

Eric Redmond

Language: English

Pages: 299

ISBN: 2:00343918

Format: PDF / Kindle (mobi) / ePub


This book is designed to help experienced developers quickly start writing
Google Glass applications with the Mirror API. Although this book covers
using the interface with Google’s Java Mirror Client code, the Mirror API itself
is an HTTP interface with support for many languages. This means that many
of the lessons about the Mirror API itself can apply to languages beyond the
simple Java client.
The pertinent code is covered in the book, and the rest can be downloaded
along with the book (or from GitHub.1)
You needn’t be a Java expert to follow Part One of this book, but it can help
to know your way around the syntax and Eclipse editor. You may also get
more out of Part One if you’re familiar with Google App Engine, although you
can use any Platform as a Service (PaaS) or host your own Glassware applications.
Part Two requires a much more in depth knowledge of Java, and there
we’ll be using The Intellij-based Android Studio.

Professional Embedded ARM Development

Unity for Absolute Beginners

C# Quick Syntax Reference

Big Data Analytics: Disruptive Technologies for Changing the Game

C# 6.0 Cookbook (4th Edition)

Boost.Asio C++ Network Programming

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

short-lived, onetime code. 4. Our client sends that code to Google’s authorization server. 5. Assuming the auth code is valid, the authorization server issues a reusable access token and a refresh token. An access token has a time-to-live, which helps ensure security. If the token ever fell into the wrong hands, an attacker would be limited in how much time he had to access a user’s resources. Figure 11—OAuth 2.0 protocol flow The Glassware endpoints are URLs defined in your GAE application,

Glass scopes doesn’t hurt if you plan to reference location as well as the timeline. In fact, you should, since during authorization the user can see exactly what you’ll be accessing. One Location When your application asks Google to track the location of a Glass device, Mirror provides the positions of the device over time, and assigns an ID to each location. The interesting bits of a Glass location object are the Glass device’s latitude, longitude, and accuracy in meters. Like with all Mirror

represent ChittrChattr, and the second is a create a new Subscription to inform Mirror that your app wants to be notified when a user issues a TAKE_A_NOTE command to ChittrChattr. Before adding any Mirror code, you’ll need the Mirror API client. Since our app is written as a Java web app in Android Developer Tools, you can add it easily enough: right-click the project, then choose Google -> Add Google APIs, search for mirror to find the Google Mirror API, select it, and click Finish.

unpublish the object if it’s still published, and remove the Service field reference. chapter-11/Stats/app/src/main/java/glass/stats/StatsService.java public void onDestroy() { if( liveCard != null && liveCard.isPublished() ) { liveCard.unpublish(); liveCard = null; } super.onDestroy(); } Let’s go back and look at the most interesting LiveCard method called here, setViews(), and the RemoteViews object it receives. RemoteViews and View Layouts In the section Live Card Lifecycle on page 148 we

will set running to false, and join() this draw frame thread back up with the main thread. This kills the animation loop. Drawing So far we’ve created some balloon assets, a DirectRenderingCallback object that the SurfaceHolder can call back against, and an animation loop that will run at 24 frames per second. But the one thing we haven’t done yet is actually draw anything on the screen. Here is a partial UML of what is being called. Partify Proc LiveCard getSurfaceHolder() Drawing takes place

Download sample

Download

About admin