Tip:
Highlight text to annotate it
X
Hi everyone, I'm Chris Broadfoot.
Welcome to this week's Google Maps Developer Shortcut.
I'm going to show you how to get started with the Google
Maps Android API in under five minutes.
I've just released a project called How I Map Android.
It's on github.com/googlemaps.
Go ahead and check out the repository.
Now you could take a fork of it if you wanted, or you can
download the zip file if that's easier.
All of them's good.
If I scroll down here, you can see there's instructions in
more detail.
But follow along with this video.
So if I go into the directory, you can see that all the files
are checked out.
Now you can use Eclipse, IntelliJ, or Ant, they're all
fine and will work.
First I'll show you how to import the
project into Eclipse.
I'm going to use a brand new workspace just to make sure
that everything's clean, and we're going to go and import
that project there, and run the hellomap.
So File, Import, you want to import an existing Android, go
and choose the directory, press Open, make sure that
both of those check boxes are clicked, press finish.
I'm not sure what that is, but I think it'll still work.
If I close the perspective and reopen the Java perspective,
we'll see all of our files.
Close that one.
So the most important file here, immediately, is the
Androidmanifest.xml.
Now you're going to have to go and add you API key down here,
I'll show you how to do that in just a moment.
I'll show you quickly how to import into IntelliJ.
On the home screen, press Open Project, or you can go File,
Open Project.
Once again, navigate to the project.
Press choose.
It's going to open up.
Now the first thing you'll have to do is to add the
Android SDK to the project definition.
So you can do that by going File, Project Structure, and
choose your Android SDK here.
Now, if you don't have them there already, you can go New,
Android SDK.
Set that all up.
It's very easy.
Press OK.
If I go into project, you can see all the files here again.
Androidmanifest.xml, it's very important.
Now to run the project, we're going to have to go into Edit
Configurations.
Press the plus sign, Android application, choose the
hellomap module.
We want a USB device.
You can't use an emulator to run Android maps applications.
Go ahead and press OK.
I've forgotten the module, the hellomap module.
Press OK, make sure your phone is plugged in and unlocked.
Now head over to the Google API's console.
You'll have to create a new project, enable the Android
API in there, the Android maps API.
Head over to API access, and create a new Android key.
There's instructions on how to get your debug key store
certificate in here, and you'll want to make sure
you're using the com.example.hellomap package.
Now go ahead and take your key, put it into your Android
manifest, hit Run in Eclipse or IntelliJ, Ant works just
fine as well.
And you'll see a map on your phone.
That's it, enjoy your Android maps development experience,
and I'll see you next time.