-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmaps.html
More file actions
124 lines (117 loc) · 23.3 KB
/
maps.html
File metadata and controls
124 lines (117 loc) · 23.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Google Maps · codebar android tutorials</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="# Android Dev - Google Maps"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="Google Maps · codebar android tutorials"/><meta property="og:type" content="website"/><meta property="og:url" content="https://codebar.github.io/android-tutorials/"/><meta property="og:description" content="# Android Dev - Google Maps"/><meta property="og:image" content="https://codebar.github.io/android-tutorials/img/undraw_online.svg"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://codebar.github.io/android-tutorials/img/undraw_tweetstorm.svg"/><link rel="shortcut icon" href="/android-tutorials/img/favicon.ico"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/><link rel="alternate" type="application/atom+xml" href="https://codebar.github.io/android-tutorials/blog/atom.xml" title="codebar android tutorials Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://codebar.github.io/android-tutorials/blog/feed.xml" title="codebar android tutorials Blog RSS Feed"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script src="/android-tutorials/js/scrollSpy.js"></script><link rel="stylesheet" href="/android-tutorials/css/main.css"/><script src="/android-tutorials/js/codetabs.js"></script></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/android-tutorials/"><img class="logo" src="/android-tutorials/img/codebar-full-white-logo.png" alt="codebar android tutorials"/><h2 class="headerTitleWithLogo">codebar android tutorials</h2></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class=""><a href="/android-tutorials/docs/setup" target="_self">Getting Setup</a></li><li class="siteNavGroupActive"><a href="/android-tutorials/docs/cookie-clicker-java" target="_self">Kotlin Tutorials</a></li><li class=""><a href="/android-tutorials/blog/" target="_self">Blog</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><div class="hamburger-menu"><div class="line1"></div><div class="line2"></div><div class="line3"></div></div></div><h2><i>›</i><span>Java Tutorials (deprecated)</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle">Kotlin Tutorials</h3><ul class=""><li class="navListItem"><a class="navItem" href="/android-tutorials/docs/krumble">Krumble</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Java Tutorials (deprecated)</h3><ul class=""><li class="navListItem"><a class="navItem" href="/android-tutorials/docs/cookie-clicker-java">Cookie Clicker (Java)</a></li><li class="navListItem"><a class="navItem" href="/android-tutorials/docs/layouts">Android Layouts</a></li><li class="navListItem navListItemActive"><a class="navItem" href="/android-tutorials/docs/maps">Google Maps</a></li><li class="navListItem"><a class="navItem" href="/android-tutorials/docs/activity-lifecycle">Activity Lifecycle</a></li><li class="navListItem"><a class="navItem" href="/android-tutorials/docs/espresso">Espresso UI Testing</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Other Resources</h3><ul class=""><li class="navListItem"><a class="navItem" href="/android-tutorials/docs/more-resources">Other Resources</a></li></ul></div></div></section></div><script>
var coll = document.getElementsByClassName('collapsible');
var checkActiveCategory = true;
for (var i = 0; i < coll.length; i++) {
var links = coll[i].nextElementSibling.getElementsByTagName('*');
if (checkActiveCategory){
for (var j = 0; j < links.length; j++) {
if (links[j].classList.contains('navListItemActive')){
coll[i].nextElementSibling.classList.toggle('hide');
coll[i].childNodes[1].classList.toggle('rotate');
checkActiveCategory = false;
break;
}
}
}
coll[i].addEventListener('click', function() {
var arrow = this.childNodes[1];
arrow.classList.toggle('rotate');
var content = this.nextElementSibling;
content.classList.toggle('hide');
});
}
document.addEventListener('DOMContentLoaded', function() {
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
createToggler('#tocToggler', 'body', 'tocActive');
var headings = document.querySelector('.toc-headings');
headings && headings.addEventListener('click', function(event) {
var el = event.target;
while(el !== headings){
if (el.tagName === 'A') {
document.body.classList.remove('tocActive');
break;
} else{
el = el.parentNode;
}
}
}, false);
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
if (!toggler) {
return;
}
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><h1 class="postHeaderTitle">Google Maps</h1></header><article><div><span><h1><a class="anchor" aria-hidden="true" id="android-dev-google-maps"></a><a href="#android-dev-google-maps" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Android Dev - Google Maps</h1>
<h2><a class="anchor" aria-hidden="true" id="introduction"></a><a href="#introduction" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Introduction</h2>
<p>This tutorial won’t assume too much about your familiarity with Android or Android Studio.
You will need Android Studio installed, and you’ll need a Google account (a Gmail account, or the Google account you use for your phone will be fine).</p>
<p>This tutorial takes you through the steps on <a href="https://developers.google.com/maps/documentation/android-api/start">https://developers.google.com/maps/documentation/android-api/start</a>, explaining and illustrating the process of getting an application up and running that displays a Google Maps view, ready to extend to do whatever map-related things you may want to do!</p>
<h2><a class="anchor" aria-hidden="true" id="create-a-new-project"></a><a href="#create-a-new-project" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Create a new project</h2>
<p>Android Studio provides a handy template to quick-start you making an app that focuses on Google Maps. We are going to take advantage of this, get it running, and then see what we can do with it.</p>
<ol>
<li><p>Create a new project. You can choose whatever name and domain you like, but I’d suggest to target API 19 as the minimum SDK level (it’s selected by default at the time of writing) - selecting lower levels may throw up little issues in the tutorial, and you don’t want to have to worry about that right now! Selecting a higher level can avoid one particular issue the tutorial deals with, but it’s helpful to know about that anyway!</p></li>
<li><p>Select the Google Maps Activity when presented with the choice. You can recreate everything that this template provides you with yourself, but this saves us some time. There’s nothing special about this Activity itself, it just comes set up with a Map Fragment, ready to get started with.
<img src="https://d2mxuefqeaa7sj.cloudfront.net/s_ACC90D09233A53E485AF629987F27DF866A7AA6BAE5C1ABA6BC69EB9EA2F3726_1487880192702_Screen+Shot+2017-02-23+at+19.54.45.png" alt=""></p></li>
<li><p>Choose a name for your Activity and its layout; it doesn’t matter what names you choose, but this tutorial will call the Activity “MapsActivity” and the layout “activity_maps”.</p></li>
</ol>
<h2><a class="anchor" aria-hidden="true" id="what-do-we-have-here"></a><a href="#what-do-we-have-here" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>What do we have here?</h2>
<p>You’ll be presented with a screen like this, which contains some instructions:</p>
<p><img src="https://d2mxuefqeaa7sj.cloudfront.net/s_ACC90D09233A53E485AF629987F27DF866A7AA6BAE5C1ABA6BC69EB9EA2F3726_1487880369756_Screen+Shot+2017-02-23+at+20.05.12.png" alt=""></p>
<p>It looks like we’ll need a “Google Maps API key”! This goes in <code>google_maps_api.xml</code>; it’s where we hold the key we’ll use to access the Google Maps API. On the left you can also see the <code>activity_maps.xml</code> layout and <code>MapsActivity</code> class; we’ll be coming back to those later.</p>
<h2><a class="anchor" aria-hidden="true" id="getting-an-api-key"></a><a href="#getting-an-api-key" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Getting an API Key</h2>
<div class="aside idea">
<p class="aside-title">Aside: APIs</p>
An API is what’s used by apps and websites (or the servers behind them) to talk to each other. Sometimes these APIs are free and open - any person (or app) can talk to them and get information from them. Google’s Maps API, which allows us to ask it for map data, is free, but it requires a key connected to a Google account. Essentially, this allows them to stop you from abusing their API, say by spamming it, and allows them to charge businesses for extras. That won’t be a problem for us!
</div>
<p>Keys are linked to an app; essentially we’ll register our app’s key with Google Maps and they’ll give us an API key that our app uses when it makes a request.</p>
<ol>
<li>Copy the suggested link into your web browser; you should see a screen like this (perhaps once you’ve logged into/created your Google account):</li>
</ol>
<p><img src="https://d2mxuefqeaa7sj.cloudfront.net/s_ACC90D09233A53E485AF629987F27DF866A7AA6BAE5C1ABA6BC69EB9EA2F3726_1487881543251_Screen+Shot+2017-02-23+at+20.15.51.png" alt=""></p>
<ol start="2">
<li><p>Make sure “Create a project” is selected, and continue.</p></li>
<li><p>Give it a minute to do its thing and be presented with this screen:
<img src="https://d2mxuefqeaa7sj.cloudfront.net/s_ACC90D09233A53E485AF629987F27DF866A7AA6BAE5C1ABA6BC69EB9EA2F3726_1487881768198_Screen+Shot+2017-02-23+at+20.26.52.png" alt=""></p></li>
<li><p>Keys to the Kingdom! Click “Create API key” and you’ll be presented with something like this (hopefully with a string of characters instead of a black box though!)
<img src="https://d2mxuefqeaa7sj.cloudfront.net/s_ACC90D09233A53E485AF629987F27DF866A7AA6BAE5C1ABA6BC69EB9EA2F3726_1487881920458_Screen+Shot+2017-02-23+at+20.29.51.png" alt=""></p></li>
<li><p>Copy the key, switch back to Android Studio, and paste it over where it says “YOUR_KEY_HERE” back at the bottom of google_maps_api.xml.</p></li>
<li><p>You’ve now given your app the key it needs, but we should finish up on the website. Go back to the “API key created” window and click “Restrict Key”.
<img src="https://d2mxuefqeaa7sj.cloudfront.net/s_ACC90D09233A53E485AF629987F27DF866A7AA6BAE5C1ABA6BC69EB9EA2F3726_1487882213929_Screen+Shot+2017-02-23+at+20.33.19.png" alt=""></p></li>
</ol>
<p>Here we can give our key a name (so that later we can remember that we used this on our maps tutorial app) - you can probably come up with something better than “API key 1”. We’re going to restrict this to Android apps, though it’s worth noting that you can use a similar process for other platforms too.
The certificate fingerprint and the package name at the end are automagically filled for us because they were part of the initial link we copied, but if you were doing it manually you would be able to get this information from your project. This prevents the key from being used by apps that aren’t listed here, but also allows you to share the same key between multiple apps if you want to.</p>
<p><img src="https://d2mxuefqeaa7sj.cloudfront.net/s_ACC90D09233A53E485AF629987F27DF866A7AA6BAE5C1ABA6BC69EB9EA2F3726_1487882669814_Screen+Shot+2017-02-23+at+20.42.32.png" alt=""></p>
<p>Ok, we’re done with the website now!</p>
<h2><a class="anchor" aria-hidden="true" id="nice-web-stuff-done"></a><a href="#nice-web-stuff-done" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Nice! Web-stuff Done!</h2>
<p>Have a drink or something if you feel like; next up we’re going to fix Google’s code! :D</p>
<h2><a class="anchor" aria-hidden="true" id="it-just-works-or-how-i-learnt-to-stop-worrying-and-love-dex-method-count"></a><a href="#it-just-works-or-how-i-learnt-to-stop-worrying-and-love-dex-method-count" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>It Just Works™ (or “how I learnt to stop worrying and love dex method count”)</h2>
<p>Connect your phone to your machine, make sure development mode is enabled and that you can push apps via USB, and try running the app with the green “play” button at the top of the screen:</p>
<p><img src="https://d2mxuefqeaa7sj.cloudfront.net/s_ACC90D09233A53E485AF629987F27DF866A7AA6BAE5C1ABA6BC69EB9EA2F3726_1487883650043_Screen+Shot+2017-02-23+at+20.59.27.png" alt=""></p>
<p>You’ll see this at the bottom, showing that a build is happening:</p>
<p><img src="https://d2mxuefqeaa7sj.cloudfront.net/s_ACC90D09233A53E485AF629987F27DF866A7AA6BAE5C1ABA6BC69EB9EA2F3726_1487883705889_Screen+Shot+2017-02-23+at+21.01.19.png" alt=""></p>
<p>Then (if Google doesn’t fix this at some point) you’ll get a delightfully cryptic message like this:</p>
<p><img src="https://d2mxuefqeaa7sj.cloudfront.net/s_ACC90D09233A53E485AF629987F27DF866A7AA6BAE5C1ABA6BC69EB9EA2F3726_1487883737373_Screen+Shot+2017-02-23+at+20.58.01.png" alt=""></p>
<p>Well.</p>
<p>What’s happened is that Google’s included all of their support library code and services code, for all sorts of things that we’re not using, and there’s so much of this that it would break a limit on the number of methods allowed in a single app!</p>
<p>(This is the bit that may not happen if you’re targeting Android SDK 21 or above, because it handles dex limits differently, but your app will still be bloated with unnecessary code so this is still best practice.)</p>
<p>It’s easy enough to fix this but only including the maps service we need. Go to your app’s <code>build.gradle</code> (there are two - one for the project and one for the module. Most of the changes you make in an Android app will be in the module <code>build.gradle</code>) and look for the dependencies block that looks like this:</p>
<p><img src="https://d2mxuefqeaa7sj.cloudfront.net/s_ACC90D09233A53E485AF629987F27DF866A7AA6BAE5C1ABA6BC69EB9EA2F3726_1492331383538_Screen+Shot+2017-04-16+at+09.29.11.png" alt=""></p>
<p>(Don’t worry if your version numbers don’t match the ones if the picture - they get updated pretty often!)
The yellow highlighted line is the important one right now; instead of all of play-services we want play-services-maps; you can find a list of all the other play service components and their current versions on this page: <a href="https://developers.google.com/android/guides/setup">https://developers.google.com/android/guides/setup</a></p>
<h2><a class="anchor" aria-hidden="true" id="lets-do-this"></a><a href="#lets-do-this" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Let’s do this!</h2>
<p>Hit the play button at the top again and you should be rewarded with the app launching and pointing at Sydney!</p>
<p><img src="https://d2mxuefqeaa7sj.cloudfront.net/s_ACC90D09233A53E485AF629987F27DF866A7AA6BAE5C1ABA6BC69EB9EA2F3726_1492549387863_Screenshot_20170418-220138.png" alt=""></p>
<h2><a class="anchor" aria-hidden="true" id="taking-stock-and-next-steps"></a><a href="#taking-stock-and-next-steps" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Taking stock and next steps</h2>
<p>So, right now you can take this in several directions.</p>
<p>You can experiment with making changes to what happens when <code>onMapReady()</code> is called in <code>MapsActivity</code>, for instance changing the location from Sydney to your favourite spot. (Try something like <a href="http://www.latlong.net">http://www.latlong.net</a> to look up latitude and longitude values!)</p>
<p>If you have an idea then try bouncing it off your coach and see what you can make!</p>
<p>Alternatively, Google has some suggestions for next steps, such as changing the map’s styling (<a href="https://developers.google.com/maps/documentation/android-api/styling">https://developers.google.com/maps/documentation/android-api/styling</a>)</p>
<p>Or finding your current location and points of interest nearby (<a href="https://developers.google.com/maps/documentation/android-api/current-place-tutorial">https://developers.google.com/maps/documentation/android-api/current-place-tutorial</a>).</p>
<p>You can also draw regions and lines onto the map (<a href="https://developers.google.com/maps/documentation/android-api/polygon-tutorial">https://developers.google.com/maps/documentation/android-api/polygon-tutorial</a>) - have a look down the sidebar on that website to see a menu of things to try out!</p>
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/android-tutorials/docs/layouts"><span class="arrow-prev">← </span><span>Android Layouts</span></a><a class="docs-next button" href="/android-tutorials/docs/activity-lifecycle"><span>Activity Lifecycle</span><span class="arrow-next"> →</span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#introduction">Introduction</a></li><li><a href="#create-a-new-project">Create a new project</a></li><li><a href="#what-do-we-have-here">What do we have here?</a></li><li><a href="#getting-an-api-key">Getting an API Key</a></li><li><a href="#nice-web-stuff-done">Nice! Web-stuff Done!</a></li><li><a href="#it-just-works-or-how-i-learnt-to-stop-worrying-and-love-dex-method-count">It Just Works™ (or “how I learnt to stop worrying and love dex method count”)</a></li><li><a href="#lets-do-this">Let’s do this!</a></li><li><a href="#taking-stock-and-next-steps">Taking stock and next steps</a></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/android-tutorials/docs/en/attributions.html">Attributions</a></section><a href="https://codebar.io/" target="_blank" rel="noreferrer noopener" class="fbOpenSource"><img src="/android-tutorials/img/codebar-full-white-logo.png" alt="codebar"/></a></footer></div></body></html>