1.4: Resources to Help You Learn
- Exploring Android developer documentation
- Watching developer videos
- Exploring code samples in the Android SDK
- Using activity templates
- Browsing the Android developer blog
- Other sources of information
- Related practical
This chapter describes resources available for Android developers, and how to use them.
Exploring Android developer documentation
The best place to learn about Android development and to keep informed about the newest Android development tools is to browse the official Android developer documentation.
This documentation contains a wealth of information kept current by Google. To start exploring, click the following links on the home page:
- Get Android Studio: Download Android Studio, the official integrated development environment (IDE) for building Android apps.
- Browse sample code: Browse the sample code library in GitHub to learn how to build different components for your apps. Click the categories in the left column to browse the available samples. Each sample is a fully functioning Android app. You can browse the resources and source files, and see the overall project structure. Copy and paste the code you need, and if you want to share a link to a specific line you can double-click it to the get the URL. For more sample code, see "Exploring code samples in the Android SDK" in this chapter.
- Watch stories: Learn about other Android developers, their apps, and their successes with Android and Google Play. The page offers videos and articles with the newest stories about Android development, such as how developers improved their users experiences, and how to increase user engagement with apps.
The home page also offers links for Android developers to preview their apps for the newest version of Android, and to join the Google Play developer program:
- Developer Console: The Google Play store is Google's digital distribution system for apps developed with the Android SDK. On the Google Play Developer Console page you can accept the Developer Agreement, pay the registration fee, and complete your account details in order to join the Google Play developer program.
- Preview: Go to the preview page for the newest version of Android to test your apps for compatibility, and to take advantage of new features like app shortcuts, image keyboard support, circular icons, and more.
- Android, Wear, TV, and Auto: Learn about the newest versions of Android for smartphones and tablets, wearable devices, television, and automobiles.
Android Studio page
After clicking Get Android Studio on the home page, the Android Studio page, shown above, appears with the following useful links:
- Download Android Studio: Download Android Studio for the computer operating system you are currently using.
- Read the docs: Browse the Android Studio documentation.
- See the release notes: Read the release notes for the newest version of Android Studio.
- Features: Learn about the features of the newest version of Android Studio.
- Latest: Read news about Android Studio.
- Resources: Read articles about using Android Studio, including a basic introduction.
- Videos: Watch video tutorials about using Android Studio.
- Download Options: Download a version of Android Studio for a different operating system than the one you are using.
Android Studio documentation
The following are links into the Android Studio documentation that are useful for this training:
- Meet Android Studio
- Developer Workflow Basics
- Projects Overview
- Create App Icons with Image Asset Studio
- Add Multi-Density Vector Graphics
- Create and Manage Virtual Devices
- Android Monitor page
- Debug Your App
- Configure Your Build
- Sign Your App
Design, Develop, Distribute, and Preview
The Android documentation is accessible through the following links from the home page:
- Design: This section covers Material Design, which is a conceptual design philosophy that outlines how apps should look and work on mobile devices. Use the following links to learn more:
- Introducing material design: An introduction to the material design philosophy.
- Downloads for designers: Download color palettes for compatibility with the material design specification.
- Articles: Read articles and news about Android design.
- Scroll down the Design page for links to resources such as videos, templates, font, and color palettes.
- The following are links into the Design section that are useful for this training:
- Material Design Guidelines
- Using the Material Theme
- Components - Buttons
- Dialogs design guide
- Gestures design guide
- Notification Design Guide
- Icons and other downloadable resources
- Design - Patterns - Navigation
- Drawable Resource Guide
- Styles and Themes Guide
- Material Palette Generator
- Develop: This section is where you can find application programming interface (API) information, reference documentation, tutorials, tool guides, and code samples, and gain insights into Android's tools and libraries to speed your development. You can use the site navigation links in the left column, or search to find what you need. The following are popular links into the Develop section that are useful for this training:
- Development practices:
- Supporting Different Platform Versions
- Supporting Multiple Screens
- Supporting Different Densities
- Best Practices for Interaction and Engagement
- Best Practices for User Interface
- Best Practices for Testing
- Providing Resources
- Optimizing Downloads for Efficient Network Access Guide
- Best Practices for App Permissions
- Articles and training guides:
- Starting Another Activity
- Specifying the Input Method Type
- Handling Keyboard Input
- Adding the App Bar
- Using Touch Gestures
- Creating Lists and Cards
- Getting Started with Testing
- Managing the Activity Lifecycle
- Connecting to the Network
- Managing Network Usage
- Manipulating Broadcast Receivers On Demand
- Scheduling Repeating Alarms
- Transferring Data Without Draining the Battery
- Saving Files
- Saving Key-Value Sets
- Saving Data in SQL Databases
- Configuring Auto Backup for Apps
- Working with System Permissions
- General topics
- Reference information:
- Distribute: This section provides information about everything that happens after you've written your app: putting it on the Play Store, growing your user base, and earning money.
Installing offline documentation
To access to documentation even when you are not connected to the internet, install the Software Development Kit (SDK) documentation using the SDK Manager. Follow these steps:
- Choose Tools > Android > SDK Manager.
- In the left column, click Android SDK.
- Select and copy the path for the Android SDK Location at the top of the screen, as you will need it to locate the documentation on your computer:
- Click the SDK Tools tab. You can install additional SDK Tools that are not installed by default, as well as an offline version of the Android developer documentation.
- Click the checkbox for "Documentation for Android SDK" if it is not already installed, and click Apply.
- When the installation finishes, click Finish.
- Navigate to the sdk directory you copied above, and open the docs directory.
- Find index.html and open it.
Watching developer videos
In addition to the Android documentation, the Android Developer YouTube channel is a great source of tutorials and tips. You can subscribe to the channel to receive notifications of new videos by email. To subscribe, click the red Subscribe button in the upper right corner as shown below.
The following are popular videos referred to in this training:
- Debugging and Testing in Android Studio
- Android Testing Support - Android Testing Patterns #1
- Android Testing Support - Android Testing Patterns #2
- Android Testing Support - Android Testing Patterns #3
- Threading Performance 101
- Good AsyncTask Hunting
- Scheduling Alarms Presentation
- RecyclerView Animations and Behind the Scenes (Android Dev Summit 2015)
- Android Application Architecture: The Next Billion Users
- Android Performance Patterns Playlist
In addition, Udacity offers online Android development courses.
Exploring code samples in the Android SDK
You can explore hundreds of code samples directly in Android Studio. Choose Import an Android code sample from the Android Studio welcome screen, or choose File > New > Import Sample if you have already opened a project. The Browse Samples window appears as shown below.
Choose a sample and click Next. Accept or edit the Application name and Project location, and click Finish. The app project appears as shown below, and you can run the app in the emulator provided with Android Studio, or on a connected device.
Using activity templates
Android Studio provides templates for common and recommended activity designs. Using templates saves time, and helps you follow best practices for developing activities.
Each template incorporates an skeleton activity and user interface. You choose an activity template for the main activity when starting an app project. You can also add an activity template to an existing project. Right-click the java folder in the Project: Android view and choose New > Activity > Gallery.
Browsing the Android developer blog
The Android Developers Blog provides a wealth of articles on Android development.
The following are popular blog posts:
- Android Studio 2.2
- Keeping Android safe: Security enhancements in Nougat
- Connecting your App to a Wi-Fi Device
- Linkify your Text!
- Holo Everywhere
- Tips to help you stay on the right side of Google Play policy
- 5 Tips to help you improve game-as-a-service monetization
Other sources of information
Google and third parties offer a wide variety of helpful tips and techniques for Android development. The following are sources of information referenced by this training:
- Google Developer Training: Whether you're new to programming or an experienced developer, Google offers a range of online courses to teach you Android development, from getting started to optimizing app performance. Click the Android tab at the top of the page.
- Google I/O Codelabs: Google Developers Codelabs provide a guided hands-on coding experience on a number of topics. Most codelabs will step you through the process of building a small app, or adding a new feature to an existing app. Choose Android from the Category drop-down menu on the right side of the page.
- Android Testing Codelab: This codelab shows you how to get started with testing for Android, including testing integration in Android Studio, unit testing, hermetic testing, functional user interface testing, and the Espresso testing framework.
- Google Testing Blog: This blog is focused on testing code. Blog posts referred to in the training include:
- Stack Overflow: Stack Overflow is a community of millions of programmers helping each other. If you run into a problem, chances are someone else has already posted an answer on this forum. Examples referred to in the training include:
- How to assert inside a RecyclerView in Espresso?
- How do I Add A Fragment to a Custom Navigation Drawer Template?
- How do you create Preference Activity and Preference Fragment on Android?
- How to use SharedPreferences in Android to store, fetch and edit values
- How to populate AlertDialog from Arraylist?
- onSavedInstanceState vs. SharedPreferences
- Glide vs. Picasso
- Google on GitHub: GitHub is a Git repository hosting service. It offers all of the distributed version control and source code management (SCM) functionality of Git as well as adding its own features. Git is a widely used version control system for software development. The following are hosted within GitHub and referred to in this training:
- Miscellaneous sources of information referred to in this training:
- Codepath: Working with a TextView
- SQLite.org: Full description of the Query Language
- Atomic Object: "Espresso – Testing RecyclerViews at Specific Positions"
- Google search: Enter a question into the Google search box, prefaced by "Android" to narrow your search. The Google search engine will collect relevant results from all of these resources. For example:
- "What is the most popular Android OS version in India?" This question collects results about Android market share, including the Dashboards page that provides an overview of device characteristics and platform versions that are active in the Android ecosystem.
- "Android Settings Activity" collects various articles about the Settings Activity including the Settings topic page, the PreferenceActivity class, and Stack Overflow's How do you create Preference Activity and Preference Fragment on Android?
- "Android TextView" collects information about text views including the TextView class, the View class, the Layouts topic page, and code samples from various sources.
- Preface any search with "Android" to narrow your search to Android-related topics. For example, you can search for any Android class description, such as "Android TextView" or "Android activity".
The related exercises and practical documentation is in Android Developer Fundamentals: Practicals.