Instruction
Getting Familiar with Android Studio
After installing Android Studio and creating your first project, the next step in your Android development journey is to get familiar with the IDE. With so many windows, icons, and menu items, Android Studio might seem overwhelming at first. Once you explore the basic tools, though, you’ll see the IDE isn’t all that scary. Here’s an example of what you’ll see:
Note: The screenshot shows the New UI enabled in Android Studio Hedgehog. Toggle this under Appearance & Behavior settings. Continue reading below to find out how to adjust the appearance settings of Android Studio.
Android Studio uses windows within the IDE to display important information. The first three windows you see open by default are the Project Window (left side), the Editor Window (middle), and the Assistant Window (right side). Most commonly, you’ll use the project and editor windows. The project window will display your project structure, files, and components. Jump into any directory and open any file from the project window. Whenever you open a file, it’s displayed in the editor window. The editor window can display all the different file types associated with your project. This is where you’ll spend most of your time creating, designing, and developing your app. The assistant window will provide information about any new features included in that version of Android Studio.
Resizing Windows
You can resize windows to increase and decrease the space they take on your screen. Hover your mouse between the project window and the editor window until you see the mouse arrow turn into a resizing icon. Click and drag the window edge left and right. The windows will resize accordingly.
Hiding and Showing Windows
In addition to resizing, most windows can be hidden or detached from the IDE and float on your screen. The editor window is the only window that cannot be hidden or undocked. Here are two easy ways to hide a window:
- The top right of any window has a Minimize icon that looks like a dash. Find the minimize icon on the assistant window. Click on the Minimize Icon. The assistant window will now be hidden.
- There are also keyboard shortcuts to hide and show specific windows. For example, you can hide and show the project window with the keyboard command
Cmd-1on a Mac, orAlt-1on Windows. Use the keyboard shortcut to hide and show the project window. The full list of keyboard shortcuts is listed in the settings window. Continue reading below to find out how to get to the settings window.
Detaching Windows
Android Studio windows have five different View Modes. These modes give you the flexibility to arrange the windows and set up your development environment according to your preferences. To change the view mode of the project window, open the context menu. To do this, find the vertical Kabob icon on the top right of the window. Look for three dots arranged in a vertical order. Click the Kabob icon, and the context menu will open. Click View Mode, and you’ll see a list of view modes you can set.
Here’s what each mode is for:
- Dock Pinned: This is the default mode. It will always be displayed within the IDE alongside all other windows, even if the focus is on another window. The window will not overlap with other windows.
- Dock Unpinned: Similar to Dock Pinned, it will display within the IDE alongside all other windows. The difference is that it will automatically hide when other windows are focused.
- Undock: Just like Dock Unpinned, the window is constrained to the bounds of the IDE, and it will hide when other windows are focused. This mode introduces window layering within the IDE. The window can be moved and placed anywhere within the IDE. An undocked window will display on top of other windows.
- Float: The window is detached from the bounds of the IDE. This means you can drag it outside of the IDE. If the window overlaps the IDE, it will cover all other windows even if it doesn’t have focus.
- Window: This view mode acts like a true independent window. The window is detached from the IDE. Place it anywhere on your screen, and it will hide behind other windows when it loses focus.
Managing Resources
Now that you know your way around an Android Studio window, you can start looking at other available windows and tools. Around the border of the IDE, you’ll find icons grouped on the far left, bottom left, and far right. The first group of icons on the far left towards the top includes the Project window and Resource Manager window. Hover over the icon with your mouse and the tooltip will let you know what window that icon represents. You’ve seen the project window already. Click the Resource Manager icon to open the resource manager window. The resource manager window will display on the left panel of the screen.
The resource manager window groups and displays your static resource files in one place. Android apps will have several static resource files, such as icons, colors, and strings. The resource manager window gives you quick access to these files. You can find the same files in the project window, but you’ll have to dig through the directory tree to find them. The resource manager window is a convenient way to view the different types of resources. The window’s tab bar enables quick access to the different types. The search box allows you to find specific resources, and the plus icon on the top left will guide you through creating a new resource.
More Windows
There’s another group of icons on the bottom left of the IDE. There’s an icon for the Terminal, Logcat, and Problems windows. Notice that those windows will open across the bottom by default when docked.
- Build Window: This window won’t be visible until you build and run your app at least once. This gives you information about the latest build compilation you ran. It will also output information while it’s compiling and running.
- Logcat Window: This is where you’ll see console output messages from your device and app.
- Problems Window: Displays information about issues and errors in your project.
- App Quality Insight Window: If your app is integrated with Firebase, this window displays crash information from Crashlytics. It’s a convenient way to go directly to lines of code that may be causing crashes. Firebase and Crashlytics are both products offered by Google to help you maintain a high-quality app.
- Terminal Window: Opens a terminal console for you to interact with your computer’s file system and execute command-line tools.
- Version Control Window: Provides integration with version control systems so that you don’t have to leave the IDE to pull, commit, or push your version controlled project to remote repositories.
The far right side of the IDE contains another set of icons and windows. The most notable ones there are Gradle, Device Manager, Running Devices, and Device Explorer.
- Gradle Window: Provides insights and controls related to the Gradle build system. Android uses Gradle to automate the build process, handle dependencies, and manage project configurations.
- Device Manager Window: Displays a list of all the physical and virtual devices that can be used. This is where you go to create and manage virtual devices and connect to physical devices.
- Running Devices Window: Shows all active running devices. Here, you can interact with physically connected devices and emulators.
- Device Explorer Window: Gives you access to the file system and running processes of connected devices.
Managing SDKs
The Android Software Development Kit (SDK) is a set of tools provided by Google for you to create applications on the Android platform. It includes everything you need to build, test, and debug Android apps. The Android SDK is closely tied to Android API versions.
Android API versions represent different versions of the Android operating system. Each API level corresponds to a specific version of the Android platform, and they are assigned numerical values. These API levels are important for you to know since they determine the features, capabilities, and behavior of the Android operating system.
Each Android version is assigned a unique API level number. Android 13 is associated with API level 33, and Android 14 with API level 34. These numbers provide a standardized way for you to reference and target specific versions of the Android platform. Android Studio provides an SDK Manager to help you configure the Android SDK and API versions you will be working on.
In the Android Studio top menu bar, click on Tools and select SDK Manager. That will open the SDK Manager.
The new window that opens is the Android Studio Settings window. Older versions of Android Studio called this a Preferences Window. Depending on your version of Android Studio and operating system, the title of this window will either be Preferences or Settings. For the remainder of this article, this window will be referred to as the settings window. The settings window is where you configure settings for the IDE. The left panel of the settings window shows a list of categories. Each category represents a group of related settings. The right panel of the window displays the details for the selected category. The Keymap category is where you will find all the keyboard shortcuts for Android Studio. To open the SDK Manager, click the Languages & Frameworks category. Then, click the Android SDK subcategory.
You’ll find an Android SDK Location label at the very top of the SDK Manager window panel. That label tells you where the SDK is installed. Click the Edit button next to the Android SDK Location input field. The SDK Components Setup window will open. This is where you can change the installation directory. Click Cancel to get back to the SDK Manager window. Below the Android SDK Location label, you’ll see three tabs. These tabs help you configure different aspects of the SDK.
- SDK Platforms Tab: This shows you a list of available Android versions and their corresponding API levels. You should have Android 14.0 checked and installed. To target a different API level in your app development, you’ll need to download a different SDK. This tab allows you to select and download SDK platforms for specific Android versions. Select the checkbox next to Android 13.0 (“Tiramisu”) and click Apply. That will download and install the SDK for that Android version.
- SDK Tools Tab: Lists various tools that are essential for Android development. This includes build tools, platform tools, and additional tools required for tasks like debugging, profiling, and APK packaging. The default Android Studio installation will provide you with the basic SDK tools. Additional tools, such as Android Auto API Simulators can be installed. Click the checkbox next to Android Auto Desktop Head Unit Emulator, then click Apply. That will install the Android Auto Head Unit Emulator tool to emulate an Android Auto device.
- SDK Update Sites Tab: Allows you to manage repositories from which Android Studio fetches updates and new components. This tab is more relevant for advanced users who want to add or modify where to download the SDK data. You may need to add your update site if you have custom repositories hosting Android SDK components, your enterprise environment has strict network configurations for accessing external repositories, or you want to fetch updates related to experimental features.
Configuring the SDK Manager ensures you have the tools and resources to build, test, and deploy Android applications effectively. It’s recommended to keep SDK components up to date to leverage the latest features and improvements in the Android development ecosystem.
Setting Preferences
The SDK Manager is an example of how to use the Settings Window. Android Studio allows you to manage other options via the settings window. To access the settings window on macOS, click Android Studio from the top menu bar, then click Settings (On Windows, you click File, then click Settings). After the Window opens, click Appearance & Behavior on the left panel. The screen should look like the image below.
Earlier, you looked at the Languages & Frameworks > Android SDK section of the settings window. Now, look at the Appearance & Behavior section. This section provides customization options related to the visual appearance and behavior of the IDE. Here are some of the key things you can do in this section:
- Appearance: Set the visual theme for Android Studio, apply accessibility settings such as zoom and screen readers, and adjust your window layouts.
- New UI: The Android Studio IDE has been undergoing a visual transformation. The new UI follows the look and feel of IntelliJ IDEA. This is where you can toggle the old vs new UI of the IDE.
- Menus and Toolbars: Modify every menu and toolbar you encounter. This is where you come to organize the IDE menus to your liking.
- System Settings: This section has many subcategories. The main section allows you to modify what the IDE does when opening and closing projects. The subcategories help set a proxy in case you are behind a firewall, managing passwords and memory settings.
- File Colors: Here, you can assign different colors to file types, making it easier to visually distinguish between various file types in the project explorer.
- Scopes: This is a feature inherited from IntelliJ IDEA. You can organize files in your project into groups called scopes. Local scopes are not shared outside of your IDE. Shared scopes are shared outside of your IDE when you share your project with others. This section is where you create and manage scopes.
- Notifications: Android Studio can notify you of events such as build failures or emulator starts. This section is where you can configure when and how you receive the notifications.
- Quick Lists: This is where you can configure your keyboard shortcuts for an action or group of actions you commonly execute.
- Path Variables: In some cases, you may need to access resources that are not part of your local project. They may even be on a shared network drive or your teammate’s computer. The path variables screen allows you to define absolute paths for those resources. The Android Studio IDE can use that path across all projects.
Installing Plugins
Now that you are more familiar with the IDE and have customized it to your liking, it’s time you learned about plugins. Plugins are additional software components that extend the functionality of the IDE. Developers, third-party organizations, or Google can create them. Once they are created, they are distributed through a plugin repository for all to use. Some common types of plugins are code quality and inspection, version control integration, and database tools.
Use the Plugin Manager to install and manage plugins in Android Studio. To access the plugin manager, open the settings window and click Plugins in the left panel.
The plugin manager will display a list of plugins available in the marketplace. Scroll through the list to browse the plugins or use the search bar to find a specific plugin quickly. Click a plugin to see the details screen on the right panel. The detail screen will tell you more about the plugin — such as the developer, an overview, what’s new, reviews, and more.
To install a plugin, click the Install button. The IDE will install and configure the plugin for you. Sometimes, you may need to restart the IDE for changes to take effect. Click the Installed tab at the top of the plugin manager screen. You’ll see a list of all the plugins you currently have installed. From this view, you can also disable or uninstall a plugin.
The gear icon at the top of the plugin manager screen allows you to add custom repositories for plugins, manage proxy settings and certificates in case you have trouble accessing the plugin repository, and enable or disable all the plugins you have installed.
Continue to the Video Demo to see a live demonstration of how to use and configure the Android Studio IDE.