Welcome to the Advanced Android Development course, created by the Google Developers Training team. Take this course to learn how to add advanced functionality to your Android apps.
To learn about other Android training created by the Google Developers Training team, visit Google Developers Training: Android.
This course provides a series of codelabs that teach you how to add advanced features like fragments, accessibility and local language support, custom views, animations, and geo capabilities to your apps.
We recommend you take the codelabs in sequence, but it is not a requirement. Each of the lessons is independent of previous lessons in the course (although all lessons assume you know the basics of building Android apps). For example, you can learn how to create custom views without having learned how to use sensors.
To take the Advanced Android Development course, you must have Java programming experience and know the fundamentals of how to build an Android app using the Java language.
This course builds on skills taught in the Android Developer Fundamentals course. Specifically, you should know how to do the following:
- Install and use Android Studio.
- Run apps from Android Studio on both a device and an emulator.
- Create and use activities in Android.
- Use views to create your app's user interface (UI).
- Enable UI through click handlers.
- Create layouts using the Android Studio layout editor.
- Create and use RecyclerViews.
- Run tasks in the background.
- Save data in Android shared preferences.
As you work through the codelabs in the Advanced Android Development course, you create apps. The solution code for the apps that you create is available in GitHub.
Teaching the course
If you're interested in teaching Advanced Android Development as an instructor-led class, you can find links to additional materials, including slide decks and concept guides, at developer.android.com/courses/fundamentals-training/overview-v2.
Advanced Android Development includes five teaching units:
- Unit 1: Expand the user experience
- Unit 2: Make your apps fast and small
- Unit 3: Make your apps accessible
- Unit 4: Add geo features to your apps
- Unit 5: Advanced graphics and views
Each unit contains several codelabs.
Unit 1: Expand the user experience
This unit teaches you how to extend your apps to improve the user experience. You learn how to use fragments, app widgets, and sensors.Unit 1 includes the following codelabs:
- 1.1: Fragments
- 1.2: Fragment communication
- 2.1: App widgets
- 3.1: Sensor data
- 3.2: Sensor-based orientation
Unit 2: Make your apps fast and small
This unit teaches you how to use tools to identify performance issues in your apps so you can make your apps run faster and more efficiently.Unit 2 includes the following codelabs:
- 4.1 Part A: Profile GPU Rendering tool
- 4.1 Part B: Debug GPU Overdraw and Layout Inspector tools
- 4.2: Memory Profiler tool
Unit 3: Make your apps accessible
This unit teaches you how to localize your apps to other languages and how to make your apps accessible to everyone, including users with disabilities.Unit 3 includes the following codelabs:
- 5.1: Add language support
- 5.2: Use locale to format data
- 6.1: Explore accessibility in Android
- 6.2: Create accessible apps
Unit 4: Add geo features to your apps
This unit teaches you how to extend your apps to add location functionality. It covers detecting and using the device location, using the Places API, and generating and showing maps.Unit 4 includes the following codelabs:
Unit 5: Advanced graphics and views
This unit teaches you how to create a custom view that extends or replaces the functionality of views such as buttons and text fields. You also learn how to create advanced graphics and animations, and how to use media files in your app.Unit 5 includes the following codelabs:
- 10.1 Part A: Customize View subclasses
- 10.1 Part B: Custom view from scratch
- 11.1 Part A: Create Canvas objects
- 11.1 Part B: Draw on Canvas objects
- 11.1 Part C: Apply clipping to Canvas objects
- 11.2: SurfaceView objects
- 12.1: Property animations
- 13.1: Play video in a VideoView
The codelabs in the Advanced Android Development course assume that you're using the latest version of Android Studio, and some of the codelabs require at least Android Studio 3.2.
To set up the latest version of Android Studio, follow the steps below.
If you need more help, see the 1.1 Android Studio and Hello World codelab in the Android Developer Fundamentals course, or these resources:
- Android Studio release notes
- Android Gradle plugin release notes
- Run apps on a hardware device
- Android Studio Preview documentation, which explains how to get and install preview versions of Android Studio
1. Get Android Studio 3.2 or later
You can keep two independent versions of Android Studio on your development machine, if you want to.
- Download Android Studio for Windows.
- Unpack the zip file.
- Rename the resulting folder to something unique like "Android Studio 3."
- Move the folder to a permanent location, such as next to your existing Android Studio install in
C:\Program Files\Android\Android Studio 3\bin\, launch
studio64.exe. Or if you're on a 32-bit machine, launch
- To make the version available in your Start menu, right-click
studio64.exeand click Pin to Start Menu.
- Download Android Studio for Mac.
- Unpack the zip file.
- Drag the app file into your Applications folder.
- Launch the app.
- Download Android Studio for Linux.
- Unpack the zip file.
- Rename the resulting folder to something unique like "android-studio-3".
- Move the folder to wherever you have your stable version, such as within
/usr/local/for your user profile, or within
/opt/for shared users.
- Open a terminal, navigate into
android-studio-3/bin/, and execute
- To make the new version available in your list of apps, select Tools > Create Desktop Entry from the Android Studio menu bar.
2. Update Android Studio
- Open Android Studio.
- If you are not prompted to update, select Android Studio > Check for updates....
- Continue to check for updates, until you see a dialog saying that you have the latest version.
3. Build an app to verify your Android Studio installation
You probably need to install additional SDK downloads before your app builds.
- Open Android Studio, then open an existing app of some complexity. When you build an app that you built with a previous version of Android Studio, you may get errors about components and libraries that are missing.
- Click the links as prompted by the error messages, and install the needed components.
- Update Gradle, if you're prompted to do so.
- Follow the prompts until your app finishes building.
4. Run the app on a mobile device
- On your mobile device, enable developer options, if they are not already enabled. To find these settings on the device, open Settings > Developer options.
- On Android 4.2 and higher, the Developer options screen is hidden by default. To make the screen visible, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options at the bottom.
- In Developer options, enable USB Debugging. This is necessary for your development machine to see and access your mobile device.
- Connect the mobile device to your development computer with a USB data cable.
- In Android Studio, click Run.
- You may be prompted to install HAXM and emulator images. If you have been using several emulator images, this installation can take a while. Your largest update may be over 1 GB and will take some time to download even on a fast connection. You can postpone the system image downloads and run them later from the AVD manager.
- After installation, choose your device and run the app.
5. Run the app on an emulator
- If the app is running on your device, stop it.
- Run the app again, choosing an emulator. Your emulator may update before it runs your app.
- If you don't have an emulator, click Create Virtual Device in the Select Deployment Target dialog. Choose a phone and an existing system image, if you have one, because additional system images are large to download.
- Make sure that the app runs correctly.
6. Create and run Hello World
To make sure that you're ready to work, create and run a Hello World app:
- Create a new project using the Basic Activity.
- Accept all the defaults.
- Run the app on any device or emulator.
Start the Advanced Android Development course by taking the first codelab in Unit 1, 1.1: Fragments.