CHRISTOPHER BARTHOLOMEW: Good afternoon.
Thank you for coming to the Google Glass-- Breaking
Through the Glass Ceiling session, or seminar.
This specific seminar isn't really based upon, like, coding examples.
It's essentially when I taught this same--
or when I mentored students for CS50 last year on Google Glass projects,
it wasn't the coding that really, really affected them.
It was the, well, how do I take all these tools that Google has given me,
and use them to build a specific application?
We're going go over a couple things.
We're going to go over design patterns.
We're going to go over applications.
We're going to go over exactly how to take all the knowledge that Google
is going to give to you-- because Google is extraordinary in the sense of giving
you all the samples you need.
They're going to give you all the documentation you need to implement it.
But we're going to use that knowledge that they've
given you to create Glassware, Glass applications.
So let's get started here.
So a couple things that you should just keep in the back of your head
whenever you're doing Google Glass applications.
Because one of things about Google Glass in
itself is that it's a controversial piece of technology
that not many folks actually use.
So in the back of your head, you should always
think about-- the ultimate success of any wearable technology
depends on the applications that are available for it.
If there's no good applications for a specific device, then it's worthless.
>> Another thing is as Glass developers, the challenge
is to create apps that are more convenient and innovative
than our own mobile device apps.
And this doesn't actually mean that you have
to create a whole brand new application.
I mean for example, I can just simply go, OK Glass, take a picture,
share with.
And then I can just say, share.
OK Glass.
Share.
And I can share it to my circles just like that on Google+ or something.
>> It's a lot quicker than me going out here, taking a picture,
and then essentially doing the same thing.
So it makes it more convenient.
It's an innovative way to do things a little bit more quicker.
>> Now, another way to think about a Google Glass application,
or any type of wearable technology app, is that if you completely
wiped your mobile device, what would be the first five
applications that you would actually download, and why?
So just keep those in the back of your head
when you're going to start designing a Google Glass application.
>> So what's the agenda?
First thing that we're going to do is we're
going to basically say, what is Glass?
We're going to talk about the Glass timeline, basically the thing that
moves across the screen when you use the controller along the side.
We're going to talk about design patterns for Glassware.
>> We're going to talk about mirror API versus the glass developer kit.
I'll throw that around a lot, essentially,
because the mirror API was the original application program
interface that was released by Google.
That's cloud based.
Whereas the GDK, the Glass Development Kit,
was released later down the road, essentially so that
you can actually use the hardware capabilities in Google Glass.
We'll go over some professional tips, and also, essentially, some resources.
>> So instead of explaining exactly what is Glass overall,
I'm just going to use the one minute video
that Google has provided to kind of go over it,
because I think that's essentially the best way to do it without me giving
Glass to every single person here.
[VIDEO PLAYBACK]
-Here are the basics of how to use Glass.
This is your touchpad.
It runs from your temple to your ear.
Tap the touchpad to wake up Glass.
You should see the display above your line of sight.
Adjust it to see everything.
>> The home screen shows a clock.
This is your timeline.
It's a row of cards.
Things to the left are happening now or coming up,
like the weather, an upcoming flight, or an event in your calendar.
You can tap on any card to see more.
Swipe down anywhere to go back to the timeline.
>> Cards to the right of the home screen are from the past.
For example, messages, videos, or photos.
Tap on a photo to share it, and choose one of your friends.
Swipe down to go back to standby.
And have fun exploring.
>> [END VIDEO PLAYBACK]
CHRISTOPHER BARTHOLOMEW: So that's the generic user
interface for Google Glass.
Essentially, it's a very simple, timeline-focused UI
that allows the user to use not only voice commands, but also
this bar along the right-hand side to swipe really
quickly through different specific dimensions of the different Glass time
cards.
>> So what's on Glass?
Well, the display is 640 by 360.
The camera in itself is a five megapixel camera that does 720p video recording.
It has Wi-Fi and Bluetooth on it, but it does not have cellular.
So in order use Glass outside of a Wi-Fi network,
you'll have to essentially link it to your phone using a hotspot.
>> The storage is about 12 gigabytes, and that's not
including the operating system.
It's 16 total essentially.
It has two gigabytes of RAM.
And there's some additional great pieces of technology that are built in.
You have a gyroscope.
You have an accelerometer.
You have an ambient light sensing and proximity
sensor, which is used for, like, blinking.
For example, if I blink, it will take a picture, which is kind of strange.
But it's one of those pieces that you can leverage inside of the SDK.
>> And you also have a bone conduction audio transducer.
So that allows me to really kind of whisper, OK Glass.
And then it will access to my commands.
So that overall is what Google Glass is.
>> So let's get more into the nitty gritty of what these time cards are,
and how we can use them to do different things.
So there are three types of timeline cards.
There's the static card, which displays text, HTML, images, and video.
These things can also be used to invoke these things called a live card,
or immersions.
And we'll talk about that in a little bit.
>> A live card displays cards that are important at the current moment--
stuff that's rendered, essentially.
Stopwatch is a good example for this.
>> And an immersion displays what we call an Android activity that
basically takes over the entire screen.
So the idea here is you're able to make a lot of good, clean, crisp,
and dynamic applications, whether it's just a simple HTML CSS
template, whether something that's going on and active.
This is an image of a game called Zombies Run, which
is actually pretty fun.
We'll look at that.
And this is a game here that uses the gyroscope-- I keep saying gyroscope--
yeah, it is gyroscope .
What am I doing?
The gyroscope, so that you can actually balance things on your head.
>> So let's go more into timeline cards.
Static cards can also contain a bundle of cards, for example, a photo album.
You could see that denoted by this little page flap right here.
When you tap into it, you're given another line of timeline cards.
And there you'll be able to kind of scroll through using your scroll bar,
and you'll also be able to share specific cards.
So now that you should be somewhat familiar with the different types
of timeline cards, what we're going to do
is we're going to talk about the design patterns.
And this is probably the thing that most students get caught up
with when they start diving into Google Glass development.
>> So there are three design patterns.
The first design pattern is periodic notifications.
And what that does it uses the mirror API web services, or Android background
services to push notifications onto a timeline.
For example, if you sign up for cnn.com's app,
they would send you a notification when there's a news event that had occurred.
>> The mirror API can be used to create any language-- the mirror API can
use any language to create a web service interaction.
So essentially, like if you are not very familiar with Java,
which is what the GDK uses, and you're more interested in PHP for example,
you can write a PHP service and a Glassware application that
interacts with that, as opposed to having
to dive deeper into the Java parts of it.
The Android background services uses Java per the Glass Development Kit.
>> So what we'll do is we'll switch over to just an example on the Glass,
if we could.
Sorry for the screen.
It's tilted to the side here, for people who are inside.
There we go.
Sorry about that.
Takes a little bit to load here.
>> So this is an example of something that The New York Times would send.
It's a periodic notification that contains multiple static cards that
has information about it.
So if I click into it-- and this will load-- there we go.
If I click into it, then what you'll get here
is you'll get information about a headline or a story.
You can also attach things to it so that you can actually read aloud.
And what read aloud does is it will read it to you in your ear.
You can't really hear it, but essentially it's
a bone connector that will read in your head.
This is the best way to put it.
>> So that's what kind of periodic notifications are about.
There's all different types of them.
If you use Twitter, Twitter's another app
that kind of gives you an example of what these periodic notification
apps are.
>> The second design pattern-- and we'll go and go back to the thing.
The second design pattern is the ongoing task.
And essentially, this is a card that's constantly running in the background.
You can leave the card.
You can go do something else in the timeline.
But essentially, what was happening is that it's always running.
Something's always going on, like a real application,
like a stopwatch for example.
>> This can only be implemented using the Glass Developer Kit.
But you can take full advantage of all of the Glass hardware.
The Android GDK is Java only.
So if you're familiar with Java, that's great.
If you're familiar with Android development specifically,
there's a great seminar, I believe.
I'm not sure what the exact time is.
But there's a seminar on Android development.
If you are planning to do the GDK, I recommend going to that one
specifically, because it's going to overlap
exactly what you're going to use for Glass.
>> So let's see.
Let's open up another app.
Could we switch over to the thing?
OK Glass.
Start a run.
So this is a game that I use when I'm bored when I go running,
called Zombies Run.
And essentially what it does is it tracks-- it's essentially,
you're running from zombies the entire time.
But it's like if I run-- I know this is going to be really awkward--
but if I run around here, it should track or give me a pace.
It should update how far I've run, or things such as that.
>> So this is like a-- this app is essentially--
it's taking a second to update on that side-- annoying.
But essentially, what's going on here is that this is always running.
And you're interacting with it.
And you can just kind of do different things.
And so there are many apps that are like.
And there's apps that you can actually create that do the same thing.
So that's it.
>> All right.
So the next design pattern is an immersion.
Immersions will consume the entire screen and the entire timeline.
So you actually can't just jump out and go do other things if you want to.
It's like as if you're playing a game on Glass in itself.
This can only be implemented using also the GDK.
So once again, the advantages of using the GDK
is that you basically take full advantage of all the hardware that's
on Google Glass in itself.
>> So we're going to go up to one more example on the Glass.
OK Glass.
Play a game of balance.
So this is a game I like to play when I'm bored at work, just in a meeting.
Hopefully it'll show up here any second now.
There we go.
All right.
So what it is is I'm using the JavaScript
to balance these objects on my head, things like that.
So this is kind of an immersion application.
Level nine is like impossible.
>> OK, Glass.
There's also interactive game that you can do, like-- not record a video.
Stop recording.
Why are you recording?
Sorry.
Glass is acting up.
OK, Glass.
Play a game of Clay Shooter.
So this is another one of those weird interactive games
that you can mess around with.
This uses a lot of components inside of Google Glass.
Fire.
I'm horrible at this game.
And essentially, you can just use the word fire to actually go out and fire.
Fire.
Oh, it's never going to happen.
I'm going to miss it every time.
But it kind of gives you more of an example
of using all the different components to make these Glass games.
So the next thing you want to think about here
is invocation methods, a fancy term for, how do I start my application?
So there are different ways to leverage different invocation methods.
Different design patterns, for example the periodic notifications,
those won't use the OK, Glass menu.
So if you're wanting to do something that had and sent notifications,
say you have an application that reminds you about something that's happened,
you're not going to be able to bring that up using the Glass menu.
That's only something that you'll be able to do
through the Glass GDK in itself.
>> So I've been using these two terms, mirror API and Glass GDK.
And so I'm going to go into those a little bit more deeper.
So before the GDK, mirror was used primarily
as the application interaction.
It uses backend web services to accomplish
simple tasks, such as timeline subscriptions, content sharing,
and voice text.
Glassware using the mirror API can be written in almost any language.
Glassware that only uses mirror API will not
have the ability to use voice invocation methods,
nor the hardware goodies such as the gyroscope and accelerometer.
>> You can create Glassware without a physical device in hand.
So that is a nice thing.
So if you need to just create Glassware that you don't really
need the actual device, you can do that, especially
if it's hard to get an actual Google Glass, or if you don't have one,
or something of this sort.
It requires knowledge of oAuth2.
And what open authentication is if you ever
go onto a website that says sign in with your Facebook,
or sign in with your Google account, things like that, that's Open Auth.
And that is essentially going to be used because the mirror API is a cloud
service.
>> As for the GDK, the Glass Developer Kit is, in essence,
an extension to Android development.
It can only be used with Java.
Developers have full though to all the native hardware
features, including the gyroscope and accelerometer.
It's primarily used for voice invocation abilities,
as you saw-- OK, Glass, that whole menu thing--
live cards, and immersive applications.
This does require that you have the device in hand,
because you always have to be constantly loading the code up to your Glass
to test with.
>> So GDK versus mirror.
The pros are that its straightforward for Android developers,
beginner or professional.
You've got the ability to use all the native hardware.
It opens the door for interactive Glassware,
offline functionality where you don't need the internet,
and lots of documentation.
So it's well documented.
>> The cons are that it's only available in one language, Java.
And the integrated development set up can take actually a pretty long time
to do.
When I say long time, and I mean like maybe a couple hours to get it
all configured.
There are a lot of things, too, you'll have
to consider like battery life and memory usage.
I mean, I was at 100% when I started this presentation.
And I dropped 20% already.
>> So depending on the apps that you use, and depending on what your app actually
does, you want to think about, OK, what can I do with the most minimal battery
life consumption?
So those are the important things when you start using all those goodies.
>> In terms of the mirror API, you can pretty much
use almost any language that has a web framework.
You can't use C, but for example, you can use PHP, Java, Python, Ruby,
Go, other different languages.
And the cool thing is it just uses straightforward web architecture.
You make a post request.
It inserts a card.
You make a get request.
It gets cards.
>> The cons is that you do need the OAuth2 knowledge, i.e. the sign
in with your Google account.
And that can be sometimes confusing for folks.
I believe that when the seminars are posted that not only the slides,
but some other materials are attached to it.
Is that correct?
And I have a big PDF, like a nine page PDF,
on how to set all that up for people.
And it gives you an idea of like a database structure
to hold the keys and the tokens.
So I'll hopefully be able to shed some light on the OAuth
with going into that document a little bit further.
>> One of the things that is a big con is that there's no offline functionality.
You do need internet access.
If you can't decide, don't worry.
You can use both.
For example, let's say you create a game using the immersion via the GDK.
You could also create a leaderboard that's in the cloud.
Using the mirror API, you can send your score to your leaderboard web service,
so it can be displayed.
>> So you essentially want to use what's best for your application type.
Not necessarily-- you don't have to go to one side or the other.
It's just that one's going to be-- if you're going to use both,
you might have a need for that.
And it is a lot of work.
But it's definitely worth it if you can get it through.
>> So I'll give you a quick example of the mirror API and its capabilities.
So for example, one of the things that-- this
is the Glass starter project that comes with the Google samples.
It basically lays out everything that you
can do with at least the mirror API.
>> Some of the stuff that I had shown you earlier as well,
for example, the game, the balance game and those,
those are actually sample code that Google provides you.
So you see, Google has done a lot of the work for you.
You just need to basically figure out exactly how
to put your application together to better utilize
those tools and those things that they've given you.
>> This is the sample for the timeline.
But what we can do here is, the code behind on this,
is you can see exactly how they insert a message into a timeline,
or insert a picture, or insert a card with paginated HTML.
Subscriptions-- a subscription is something that you subscribe to.
For example, I subscribe to The New York Times.
And so they send my Glass, my specific Glass, updates periodically.
That's what really the mirror API is.
And on the Glass developer website, they have all this here for you,
so that you can basically leverage this.
>> So one of the other things that I wish I had
when I was developing Glass applications before, and also my students last year,
is this cool thing.
And it's called the Glassware flow designer.
And the Glassware flow designer is basically a way for you
to build a Google Glass application, so that you can actually
see what's going on.
>> So I built this kind of temporary Google Glass application here.
OK, Glass.
And then I want it to do something.
Launch a CS50 app.
And then it'll say, welcome to my CS50 app.
And then I can tap, as you can see here, for more options.
And one, I can either do an automatic A plus, or I can write my PSET for me.
So there's different things.
If you use the write my PSET option, it says, warning, not recommended.
Don't want Glass to write your PSET for you.
>> But essentially, this is a nice tool that a lot of people have missed.
And it would be great if you can help lay out
your application in one of these items.
And the cool thing too is that there's this design review button.
And what this design review button does, essentially,
is it allows the actual Google Glass team to review your app
and give you comments on it beforehand.
So a lot of cool features that the Glass team has done in order to build it,
to make it as easy as possible for you to actually write Google Glass
applications.
Yeah?
>> SPEAKER 1: Is this only design, or can you then
translate this-- does this automatically translate into code that you can use?
CHRISTOPHER BARTHOLOMEW: So the question was that, is this only for design,
and does it translate into the actual code for you?
No, it doesn't.
But what it does is it does beat a giant white board and tons
of white pieces of paper.
So you know exactly once you apply a specific card,
you know it will apply-- when you're writing your program,
oh, I want this specific card to actually launch something else.
And so it lays it out very nicely.
And if you are planning to do a Google Glass application
and you do one of these, I would submit one of these as your pre-proposal.
And I'm sure your TF will be really happy about that, because they'll
be like, oh this is what your application does.
I know what I'm expecting from it.
Because sometimes, it's really hard to keep
track of what's going on in a Glass app.
>> Let's go back to this.
Another cool thing is the utilize of the Glassware playground
to review and create content that is displaying on your application.
So what that is is a tool where you can actually design how things look.
So for example, if I want to make-- waiting for it to load here.
>> If I want to make a specific template, I can
do that here using this, essentially a tool
that they've given us, to really customize
how your actual cards are going to look.
Hello.
This is great.
Thanks, Google.
So you can actually see how your cards are
going to look when you start building them
and then you start sending them over to Google Glass.
>> The next thing is this PDF handout that I've
created in order-- if you were going to do notification
services, periodic notifications, or work with the mirror API as opposed
to the GDK.
And let me get that out for you.
>> Taking a bit to load here, sorry.
Supposed to be already open.
There we go.
>> So for example, if you want to set up using the mirror API,
I have full detailed instructions on how to do that-- how
you access the Google's API console, with what account,
how to create a specific-- enabling the mirror API,
working with open authentication, and also
how to use the playground that we just specifically looked at.
So good information here that will come with the actual slide deck.
>> Otherwise, you can also do other things here,
and specifically there's the database structure that I've created,
or that I've done for you, that you can look at
to see how to build an open authentication table for users.
So something to also understand ad keep track of,
especially if you're going to be working with the mirror API.
There you are.
>> So, a ton of resources.
What I recommend doing is going to developers.google.com/glass and read,
because there's a lot of information there,
far too much to go over the entire seminar.
But there's a lot information, that's a lot of good information, that kind of
expands more on this, especially on the code side of things.
I've also added a quick start guide for the GDK,
so that if you need to kind of jump into it,
you have the ability to do that as well.
>> I've added-- there's video right here, Android Tutorials.
There's a YouTube video that's included, that if you
want to start developing using the Android operating system,
if you're a beginner, that video will really help you do that.
Again, the Glass applications that are using the GDK
are literally just Android applications.
They can port back and forth.
>> Finally I've added a Google style guide for Java.
If there's anything specifically-- How do I do a-- you know,
what's the best way to do a for loop, in terms of Google?
That style guide will help you do those things.
>> And that's it.
So I hope you guys have enough information
to go forward with jumping into a Google Glass application.
But definitely visit the resources.
Definitely dive into the different types of applications that are available,
especially the sample applications.
Look at some of the code that they provided you.
And honestly, with your experience in CS50,
it should not be a difficult thing to break into and get in.
OK?
Thank you.