[MUSIC PLAYING]
Oh, hey.
Are you lost?
Hi, how are you?
Oh, come here.
Come here.
Let's have a look at you.
Oh hi.
What have we here?
You've got a QR code on your collar.
Wow, high tech dog.
So let's see.
Let's scan that.
So your name is Cheyenne.
Hi, Cheyenne.
How are you?
And wow, we got your mommy and daddy's address,
so you're not going to be lost.
We can find your way home.
And you got a website?
You've got a favorite TV show?
You like "Defiance"?
Yeah, I like "Defiance" too, but don't tell anybody.
I got a thing for Stahma.
And what's this?
Dog gets homicidally crazy when it sees the color red?
Oh, stacko!
[GROWLING]
Barcodes and QR codes can hold amazing amounts of data.
And having a mobile device in their pocket
giving access to this data can be greatly
empowering to your users.
I'm Laurence Moroney.
And I'm here today to talk about the barcode APIs
that ship with Google Play services
and how you can use them.
To the untrained eye, you might think that there are really
only two types of barcode, the one dimensional and the two
dimensional.
But within these, there are lots of subformats.
And you might find that, if you roll your own API
or use an off-the-shelf one, that the format you
need, or you want to use, isn't supported.
So with the Vision APIs, we've built support
for lots of different types.
No, I'm not going to try to say them all.
They typically store a number, which
could then be used as an ID in looking up data about an item.
However, with the 2D barcode types, lots of additional data,
instead of just an ID can be stored.
And using these, you don't need domain specific knowledge
to map the ID to some data.
So for example, you could have a URL, like our lost puppy had.
And that URL can be a website with data about the item
that you're tagging.
It can be a link to an app in the store.
It can really be anything you want it to be.
And by the way, as you've been watching this video,
some QR codes of "valuable extra features"
have been popping up at the bottom of the screen.
Check them out.
Indeed, when using QR codes in PDF 417,
you have lots of data types that they can store.
Here's just a few.
You've got URL, contact info, calendar event, email, phone,
SMS, Wi-Fi, geolocation, even driver's license.
And to use this in code is very, very simple.
You just create a barcode detector.
And you use a builder to build that for your context.
Now by default, it will look for the major types of barcodes
that are shown here.
You don't need to explicitly set a barcode type.
The barcode detector is smart enough to manage it itself.
But if you do want to set a specific format to be detected,
the detector has a set format method
that allows you to do this.
When it detects a barcode, it will return
a barcode graphic object.
And methods on this will allow you
to draw the bounding box for your barcode
as well as a preview of its value.
When using the Vision API barcode detection,
the orientation doesn't even matter.
So you can read your barcode if it's like this
or even like this.
Now also, importantly, all barcode interpretation
is done locally, so it's really fast, not requiring
round trips to any server.
Accessing data in the barcode is as simple as reading a property
on the barcode object.
So for example, to get the little lost puppy's website,
I was simply able to use barcode.urlbookmark property
as shown here.
And that's how simple it is to use barcodes in your app
with the Vision API.
You can start programming for this today with Google Play
services on Android.
You can find more details on the Google Developer site
at the link shown here.
Thank you, and don't forget to build better apps.
[MUSIC PLAYING]