Version 3.0.0 beta of the Maps SDK for Android is a new implementation with thesame API surface as the previous version (all classes and methods remain thesame). The main areas of change are as follows:
This is where Android Studio comes in, it allows you to compile and edit your code, or test your app before releasing it on Google Play. Installing Android Studio is also the easiest way to get a working set of tools on your PC. It will also keep your Android SDK tools up to date with its automatic updates and the Android SDK Manager. Nov 23, 2017 As mentioned, Android Studio 3.0.1 brings loads of new changes and improvements. For developers, it now supports Kotlin and also has support for newer APIs. The guide ahead will also show you how to install Android SDK, if you haven’t installed already. Read ahead to find all the tips for Android Studio 3.0.1 installation.
- The Maps SDK for Android is now distributed via a standalone static library.Previously, the Maps SDK for Android was made available as part of Google Playservices.
- Android 4.0-4.0.4 ('Ice Cream Sandwich') is no longer supported.
- Map rendering has been modernized and improved.
- Text labels for POIs are now clickable, rather than just the icon.
- Business POIs are now visible in indoor maps.
- Added incident reports icons to the traffic layer, such as roadworks,crashes, and traffic jams. These show in Normal, Hybrid and Terrain mode.
- Added support for 3D buildings with full models, e.g. Eiffel Tower.
- Increased opacity of 3D buildings to match the Google Maps application.
- Resolved an issue where markers were loading slowly (Issue 35822423).
Install the Maps SDK for Android client library
Follow these steps to manually add the v3.0.0 Beta Maps SDK for Android clientlibrary to your Android Studio project.
Note: If you're using both Maps and Places in your app, you must also add thecompanion Places static library to your Android Studio project. Thisversion of the Places static library functions identically toPlaces SDK for Android v1.1.0, and is intended for use only with thev3.0.0 Beta Maps SDK for Android.- Download the libraries:
- places-maps-sdk-3.0.0-beta.aar (optional, for use only with Maps v 3.0.0 beta)
- Copy the AAR file(s) into the
app/libs
folder of your Android Studio project. - In your project-level
build.gradle
file, add aflatDir
section to theallprojects/repositories
section, as shown in the following example: - In your app-level
build.gradle
, adjust thetargetSdkVersion
andcompileSdkVersion
to API level 28, andminSdkVersion
to 16. - Add dependencies for the client libraries to the
dependencies
section of your app-levelbuild.gradle
. The Places SDK for Android dependency is optional, include it only if your app also uses the Places SDK for Android. You can skip this step if you're using a wildcard (for exampleinclude: ['*.aar']
). - Add all of the other dependencies to the
dependencies
section of your app-levelbuild.gradle
file as follows (some of these are common dependencies, so make sure to check for duplication): The new AndroidX support libraries are supported for use with the v3.0.0 beta Maps SDK for Android. - In the
dependencies
section of your app-levelbuild.gradle
file, remove the implementation line for the previous version (it will appear similar to the following): - Sync your Gradle project.
- Convert existing configurations.
- If your existing app uses the Maps SDK for Android via Google Play services, replace all references to the
com.google.android.gms.maps
package with thecom.google.android.libraries.maps
package (use Edit > Replace in Path... in Android Studio). - If your existing app uses the Google Maps Platform Premium Plan, replace all references to the
com.google.android.m4b.maps
package with thecom.google.android.libraries.maps
package. Also, remove them4b_
prefix from all references to the XML layout attributes. For example:m4b_mapType
should becomemapType
andm4b_cameraZoom
should becomecameraZoom
.
- If your existing app uses the Maps SDK for Android via Google Play services, replace all references to the
If you are using the Google Maps Platform Premium Plan, the implementation line to remove looks like one of the following:
Import the beta-compatible utility library
If you are using the Google Maps Android API utility library, you will need to also update your project dependencies to replace the existing version with the beta-compatible version by doing the following:
1. Import the beta-compatible util library in your build.gradle
file:2. Remove the following from your build.gradle
to remove non-beta-compatible utility library:Run the samples
The Google Samples repository on GitHubincludes sample apps that demonstrate the use of the v3.0.0 Beta Maps SDK for Android.
- Places SDK for Android samples (only for use with Maps v3.0.0 beta)
The Android Developer Challenge is back! Submit your idea before December 2.
Once you install Android Studio, it's easy to keep the Android Studio IDEand Android SDK tools up to date with automatic updatesand the Android SDK Manager.
Update your IDE and change channels
Android Studio notifies you with a small bubble dialog when anupdate is available for the IDE, but you can manuallycheck for updates byclicking Help > Check for Update (on Mac, AndroidStudio > Check for Updates).
Updates for Android Studio are available from the followingrelease channels:
- Canary channel: These are bleeding-edgereleases, updated roughly weekly, and available for download atdeveloper.android.com/studio/preview.In addition to receiving canary versions of Android Studio, you will also receive previewversions of other SDK tools, including the Android Emulator.Although these builds are subject to morebugs, they do get tested and we want to offer them so you can try newfeatures and provide feedback. This channel is not recommended forproduction development.
- Dev channel: These are hand-picked canary builds thatsurvived a full round of internal testing.
- Beta channel: These are release candidates based on stablecanary builds, released to get feedback before going into thestable channel.
- Stable channel: The official stable release that isavailable for download atdeveloper.android.com/studio.
If you'd like to try one of the preview channels (Canary, Dev, or Beta)while still using the Stable build for your production Android projects, youcan install both side by side.
To change the update channel for an existing install, proceed as follows:
- Open the Preferences window by clickingFile > Settings (on Mac, Android Studio >Preferences).
- In the left panel, click Appearance & Behavior >System Settings > Updates.
- Be sure that Automatically check for updates is checked, then select a channel from the drop-down list (see figure 1).
- Click Apply or OK.
Figure 1. The Android Studio Updatespreferences.
Delete unused Android Studio directories
When you run a major version of Android Studio for the first time, it looks for directories containing caches, settings, indices, and logs for versions of Android Studio for which a corresponding installation can’t be found. The Delete Unused Android Studio Directories dialog then displays locations, sizes, and last-modified times of these unused directories and provides an option to delete them.
The directories Android Studio considers for deletion are listed below:
- Linux:
~/.AndroidStudio[Preview]_version_
- Mac:
~/Library/{Preferences, Caches, Logs, Application Support}/AndroidStudio[Preview]_version_
- Windows:
%USER%.AndroidStudio[Preview]_version_
Update your tools with the SDK Manager
The Android SDK Manager helps you download the SDK tools, platforms, andother components you need to develop your apps. Once downloaded, you can findeach package in the directory indicated as the Android SDK Location,shown in figure 2.
Sdk Tools Download
To open the SDK Manager from Android Studio, click Tools >SDK Manager or click SDK Managerin the toolbar. If you're not using Android Studio, you can download toolsusing the
sdkmanager
command-line tool.When an update is available for a package you already have, a dash appears in the check box next to the package.
- To update an item or install a new one, click the check boxso it shows a checkmark.
- To uninstall a package, click to clear the check box.
Pending updates are indicated in the left column with a download icon. Pending removals areindicated with a red cross .
To update the selected packages,click Apply or OK, then agree to anylicense agreements.
Figure 2. The Android SDK Manager.
Recommended packages
You should give special consideration to the following toolsin the SDK Tools tab:
- Android SDK Build-Tools
- Required. Includes tools to build Android apps. See the SDK Build Tools release notes.
- Android SDK Platform-Tools
- Required. Includes various tools required by theAndroid platform, including the adb tool.
- Android SDK Tools
- Required. Includes essential tools such as ProGuard. See the SDK Tools Release Notes.
- Android Emulator
- Recommended. A QEMU-based device-emulation tool that you can use to debug and test your applications in an actual Android runtime environment. See the Android Emulator release notes.
Note: Most API libraries that were previously provided by theSupport Repository packages (such as the Android Support Library, Constraint Layout,Google Play services, and Firebase) are now instead available from Google's Maven repository.Projects created with Android Studio 3.0 and higher automatically include this repository in thebuild configuration. If you're using an older project, you must manually add Google's Maven repository to your
build.gradle
file.In the SDK Platforms tab, you must also install at least oneversion of the Android platform. Each version provides several differentpackages. To download only those that are required, click the check box nextto the version name.
To see all available packages for each Android platform, clickShow Package Details at the bottom of the window.Within each platform version, you'll find the following packages:
Android Studio Download 3.0.1
Recommended. The system image is required in order to run the Android Emulator. Each platform versioncontains the supported system images. You can also download system images laterwhen creating Android Virtual Devices (AVDs) in the AVD Manager. Select either Intelor ARM based on your development computer's processor.Note: If you plan to use APIs fromGoogle Playservices (including Firebase), you must use either the Google APIs system imageor the Google Play system image (the latter includes the Play Store app).
The above list is not comprehensive and you can add other sites to download additional packagesfrom third parties.
In some cases, an SDK package may require a specific minimum revision ofanother tool. If so, the SDK Manager notifies you with a warning and addsthe dependencies to your list of downloads.
Tip: You can also customize the
build.gradle
file so each project uses a specific build chain andcompilation options. For more information see, Configuring Gradle Builds.Edit or add SDK tool sites
To manage which SDK sites Android Studio checks forAndroid tools and third party tool updates, click the SDK Update Sitestab. You can add other sites thathost their own tools, then download the packages from thosesites.
For example, a mobile carrier or device manufacturer might offer additionalAPI libraries that are supported by their own Android-powered devices. Todevelop using their libraries, you can install their Android SDK packageby adding their SDK tools URL to the SDK Manager in theSDK Update Sites.
If a carrier or device manufacturer has hosted an SDK add-on repository fileon their website, follow these steps to add their site to the Android SDKManager:
- Click the SDK Update Sites tab.
- Click Add at the bottom of the window.
- Enter the name and URL of the third party site, then click OK.
- Make sure the checkbox is selected in the Enabledcolumn.
- Click Apply or OK .
Any SDK packages available from the site now appearin the SDK Platforms or SDK Tools tabs,as appropriate.
Auto-download missing packages with Gradle
When you run a build from the command line, or when using Android Studio 3.3 or later, Gradle can automatically download missing SDK packages that a project depends on, as long as the corresponding SDK license agreements have already been accepted using the SDK Manager.
When you accept the license agreements using the SDK Manager, Android Studio creates a licenses directory inside the SDK home directory. This licenses directory is necessary for Gradle to auto-download missing packages.
Note: Accepting the license agreements using the
android
command line tool does not create this licenses directory. You must first accept the agreements using the SDK Manager to be able to use this feature. If you have accepted the license agreements on one workstation, but wish to build your projects on a different one, you can export your licenses by copying over the accepted licenses directory. To copy the licenses to another machine, follow these steps:
- On a machine with Android Studio installed, click Tools > Android > SDK Manager. At the top of the window, note the Android SDK Location.
- Navigate to that directory and locate the
licenses/
directory inside it. (If you do not see alicenses/
directory, return to Android Studio and update your SDK tools, making sure to accept the license agreements. When you return to the Android SDK home directory, you should now see the directory.) - Copy the entire
licenses/
directory and paste it into the Android SDK home directory on the machine where you wish to build your projects.
Gradle will now be able to automatically download missing packages your project depends on.
Note that this feature is automatically disabled for builds you run from Android Studio, as the SDK manager handles downloading missing packages for the IDE. You can also manually disable this feature by setting
android.builder.sdkDownload=false
in the gradle.properties
file for your project.