Easy Maps Apps in Java and Python


ALEX DANILO: Hi. As a developer, I know
my time is precious. And, of course, time is money. And time to market is
even more important. So when I start building
apps, the first thing I do is look around for
some kind of library to speed up my development. I’m Alex Danilo, and I’m
going to introduce you to some great libraries that
we’ve built for the Maps APIs. Now with Google Maps, and
all the associated APIs, you can build rich
applications that take advantage of
location-based services which brings all sorts of
functionality into your app. But of course, trying to do
that quickly is daunting. So we’ve built a bunch
of client libraries to make your job easier. These libraries are
built to support server-side applications
developed in Java and Python. So what they do is provide
access to some of our existing APIs, like the Directions
API, the Distance Matrix API, the Elevation API, the Geocoding
API, and the Time Zone API. And it makes your life simple. See, normally, when
you include maps in some kind of
application, you interface using a protocol that uses
REST principles which gives you a stateless interface
to the server somewhere. But of course, if you prefer to
develop in different languages, like Java or Python, we know
that job is really hard. So what we’ve done is we’ve
built client libraries that connect to those
services for you, and provide an interface
in your natural language. So you don’t have to speak
gobbledygook or translate Java to JavaScript, or have some
kind of bridge connection. Now there are a few
advantages of this approach. One is that we’ve
built it and tested it, so you know it’s going to work. But two, it cuts down
the lines of code. Like this is the
size of the code you’ll need to write
to actually connect. Now the beauty of this is that,
having built this nice client library in API, it gives you a
simple interface to work with. And not only that, it takes
care of authentication and keys, and things like that
which can make application development a little
bit complicated. But one of the nicest
features that I like is Retry. What this does is,
when the server maybe has some kind of intermittent
failure or flaky network connection or
something like that, especially on
mobile networks, it will take care of all of
that transparently so you do no work at all. That’s fantastic
just on its own. Another thing that a lot
of people probably like is Rate Limiting. So what this does is throttle
the connections to the server so that you won’t run
into errors caused by exceeding your quota limits. The library will let you query
as fast as you’re allowed, which frees your
application from dealing with any errors caused
by exceeding your quota. Probably the single
most important thing to think about when integrating
these client libraries is that you’re dealing
with native objects. So if you’re working
with Java, you’d actually get a Java object
that you manipulate. So the methods manipulate
the Java object directly. Python is already easy. But we save you from having to
craft and process the response and pass it back directly. So you don’t have to spend
time forming URLs or passing through JSON results, which
saves you from manually setting up model mapping. Another bonus is that, if
you’re using the Java library, it lets you connect
asynchronously or synchronously. It’s your choice how you
want to run the connection. And best of all, this
entire client library set is open source. So you can modify it or
contribute if you like. To find out more, head over to
our documentation at this URL. You can also load the source
code for either Java or Python from our GitHub
repository right here. We’d love to see
the apps you build. And we’d love you to tell
us which languages you want us to support next. I’m Alex Danilo for the Google
Developer Platform Team.

Leave a Reply

Your email address will not be published. Required fields are marked *