2. Overview
• Learn how to set up our Android development
environment
• Look at many of the tools provided with the
Android SDK
• Review the Android SDK License Agreement
• Learn about many important SDK packages
• Look at the sample applications available with
the SDK
2
3. Configuring Your
Development Environment
• Android SDK compatible with Windows,
Macintosh, or Linux systems
• Installation requirements for using this book:
– Java Development Kit (JDK), Version 13
• http://www.oracle.com/technetwork/java/java
se/downloads/index.html
– Android Studio (includes the Android SDK)
• http://d.android.com/sdk/index.html
3
4. Included with Android Studio
• Android Studio
– SDK tools
– Platform tools
– The latest Android platform
– The latest Android system image for the
emulator
4
5. Basic Installation Process
1. Download and install the appropriate JDK.
2. Download and install or unzip the appropriate
Android Studio package for your Operating
System.
3. Launch Android Studio and use the Android
SDK Manager to download and install
specific Android platform versions and other
components.
4. Install appropriate USB drivers for device
debugging, if necessary.
5. Configure your device(s) for debugging.
6. Start developing.5
7. Upgrading Android Studio
and the Android SDK
• To stay up-to-date with the latest
advancements:
– Upgrade from time to time
• Updates include:
– New, updated, or removed features
– Package name changes
– Updated tools
– Essential documents
• Overview of Changes
• API Diff Report
• Release Notes
– See http://d.android.com/sdk/installing/adding-
packages.html7
8. Exploring the Android SDK
• Android SDK major components:
– Android SDK Platform by version
– Platform tools
– SDK Build Tools
– System images
– Google APIs
– Sources for Android SDK
– Extras
– Sample applications
8
9. The Android SDK License
Agreement
• Before downloading the SDK, you must
agree to the Android SDK License
Agreement.
– This agreement is between you and
Google.
– Make sure that you understand this
license even if someone else has
accepted the agreement on your behalf!
9
10. Popular Third-Party Android
APIs
• Available outside the core Android SDK
• Installed separately
• Some are from Google, others from device
manufacturers and other providers
10
11. Popular Third-Party Android
APIs (Cont’d)
• Android Support Library
• Google Mobile Ads SDK
(com.google.android.gms.ads.*)
• Google Analytics SDK for Android
(com.google.android.gms.analytics.*)
Android Cloud Messaging for Android (GCM)
(com.google.android.gms.gcm)
Google App Indexing
(com.google.android.gms.appindexing)
• Google App Invites
(com.google.android.gms.appinvite)
• Google Play Game Services
(com.google.android.gms.games)
• Google Fit (com.google.android.gms.fitness)
11
12. Exploring the Core
Android Tools
• Android Studio
– Where you spend most of your time
developing your apps
– Provides wizards for creating, debugging,
and deploying Android apps
– Several buttons available on the toolbar for
performing helpful actions
12
13. Android Studio
• Launch the Android Virtual Device Manager
• Launch the Android SDK Manager
• Launch the Android Device Monitor
13
15. Android SDK and AVD
Managers
• The first Android toolbar icon launches the
Android Virtual Device Manager.
• The second Android toolbar icon launches
the Android SDK Manager.
15
19. Android Emulator
• Helpful tool used for designing and
developing Android applications
• Runs on your computer
• Behaves like a real device
• Load Android applications into the emulator
to test and debug them
• Generic device, not tied to any one specific
configuration
• Valuable, but should not be used as a
replacement for testing on actual target
devices
19
When installing Android Studio, make sure to select all the available components for your system setup, as seen on the Choose Components dialog of the Android Studio Setup wizard as seen here. The last component, Performance (Intel® HAXM), may not be available on your device for installation, but don’t worry if that particular component is not available. Make sure the Android SDK and the Android Virtual Device are selected for installation.
Essential documents
An Overview of Changes: A brief description of the major changes to the SDK
An API Diff Report: A complete list of specific changes to the SDK
Release Notes: A list of known issues with the SDK
Android Support Library
Adds several components available in recent SDKs to legacy versions of the SDKs. For example, the Various Loader APIs and Fragment APIs introduced in API Level 11 can be used, in compatibility form, as far back as API Level 4 using this add-on.
Google Mobile Ads SDK
Allows developers to insert Google Mobile Ads to monetize their applications. This SDK requires agreement to additional Terms of Service and registration for an account.
Google Analytics SDK for Android
Allows developers to collect and analyze information about how their Android applications are used with the popular Google Analytics service. This SDK requires agreement to additional Terms of Service and registration for an account.
Android Cloud Messaging for Android (GCM)
Provides access to a service for developers to push data from the network to their applications installed on devices. This SDK requires agreement to additional Terms of Service and registration for an account.
Google App Indexing
This SDK helps you prepare your application for indexing in Google Search so that your application may be found by users through searching.
Google App Invites
This SDK allows you to integrate app invite functionality so that your users may invite their Google contacts using SMS and email.
Google Play Game Services
Provides achievement, leaderboard, and multiplayer functionality to your games. This SDK requires agreement to additional Terms of Service and registration for an account.
Google Fit
Allows users to integrate fitness tracking functionality in their applications. This SDK requires agreement to additional Terms of Service and registration for an account.
Here is a screenshot showing the Android features present in the Android Studio toolbar.
Android Virtual Device Manager
The Android Virtual Device Manager organizes and provides tools to create and edit AVDs. To manage applications in the Android emulator, you must configure different AVD profiles. Each AVD profile describes what type of device you want the emulator to simulate, including which Android platform to support as well what the device specifications should be. You can specify different screen sizes and orientations, and you can specify whether the emulator has an SD card and, if so, what its capacity is, among many other device configuration settings.
Android SDK Manager
The Android SDK Manager facilitates Android development across multiple platform versions simultaneously. When a new Android SDK is released, you can use this tool to download and update your tools while still maintaining backward compatibility and use older versions of the Android SDK.
This is the Android Virtual Device Manager.
The built-in Android SDK Manager shows the currently installed Android SDK Platforms (top) and SDK Tools (bottom).
This is the stand-alone Android SDK Manager.
This is the Android emulator (Nexus 5 smartphone-style, Android API 22 AVD configuration).
This is the Android emulator (Nexus 9 tablet-style, Android API 22 AVD configuration).