Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member
In this last chapter of the course, I'm going to describe the common tasks that you'll follow to add a simple map to an existing Android app. I'm working in an Android app called The Explore California Tour Finder. This is an app that I built in a course called Android SDK Local Data Storage. It uses and SQL-like database to track data. And let you look at a list of tours of the state of California. There's some filtering capabilities so you can look at less expensive, and more expensive tours, and see the entire list of tours.
And you can see the details of any particular tour. This is a different version of the app that I built in the other course. And in fact it's a lot simpler. I've designed this version of the app. so that I can easily add a map to it. And I'll show you the details of what you need to do in the rest of the movies in this chapter. I'll show you some of the work that's already been done in this app. In the Application Manifest, I've already added all the permissions you need. This includes the Internet, access network state, and other standard permissions, and the MAPS_RECEIVE permission, which is unique to this application.
That is, it uses the application's package right here. The application package is org.catours.tourfinder Down at the bottom of the manifest I've declared 3 activities. The main activity, the tour detail activity, and an activity for the Google Play services license. I'll use this activity to display the Play services license, something you must do to satisfy the terms of service. Finally, as I did with the other application I've been working on in this course, I've put in an API key.
As with the other app, this API key is unique to my development computer, and it won't work with yours. If you want to work through the exercises in this chapter. Go the Google's API console and create a new a p i key for the combination of this applications package and the debug key stored on your development computer. If you want a refresher on the steps for that, go back to the earlier movies of this course. When the app is finished, here's what it will look like.
I'll go to the solution version of this application, which I've imported from the exercise files, and I'll run this version of the application on my device. WHen the application is complete, you'll be able to select a tour from the list, and you'll see a live interactive map, at the bottom of the screen. If the text associated with the tour is too long to display it'll automatically scroll. For example, the Big Sur Retreat has a long bit of text, but the user can scroll the text up and down.
There will be a marker on the map that displays information. And if you click into more details from this detail screen, you'll go to another mapping application. If a device only has Google Maps, it'll open automatically. But if there's more than one mapping application, such as Google Earth and Maps, the user will be prompted to choose one. If they choose Google Maps, that'll jump to Google Maps. Depending on the tour they select, they might see a marker appear like this, and from there they can get directions or use any of the other advanced features that are available in the full scale Google Maps app.
When they're done in the secondary mapping app They'll be able to touch the Back button a couple of times and return right back to the tour finder app. And finally there's one other very important feature, the display of the license. This is a requirement of the Terms of Service and you'll learn how to do this in this app by choosing Google Play License from the menu. And that will display the license on this screen. You'll be able to scroll up and down to look at the entire license and read it.
And when you go back, you'll be returning to the main activity. So let's go through all these tasks. I'll start with displaying the map on the screen, then I'll show you how to pass the location to another mapping app, and we'll finish up with displaying the license.
Get unlimited access to all courses for just $25/month.Become a member
82 Video lessons · 101058 Viewers
61 Video lessons · 87839 Viewers
71 Video lessons · 71720 Viewers
56 Video lessons · 103597 Viewers
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.
Your file was successfully uploaded.