Android Studio is the official Integrated Development Environment (IDE) for Android app development based on JetBrains IntelliJ IDEA. With Android Studio, you can develop apps for all Android devices. In this topic, we will go through the installation process and overview the basic functions of this IDE.
Installing
First, you need to download the Android Studio installer. All you have to do is visit the official Android Developers website, click the button "Download Android Studio", and agree to the terms and conditions. After the download is finished, launch the file.
Open the installer file and click "Next". You will see a list of components you can install. It is recommended to install the Android Virtual Device (AVD). With this tool, you will be able to run and test your apps right on your computer. If your computer does not meet the requirements, you can simply uncheck this option.
Then, select the folder where you would like to have your Studio. Wait for the installer to extract everything it needs onto your machine. After that, launch Android Studio.
You will be asked to import settings. If it is your first time using Android Studio, just press "OK", and the setup wizard will pop up. Now you can choose the type of setup: Standard or Custom.
Choose "Standard" if you don't want to deal with a bunch of settings, and the IDE will do all the work for you. If you choose "Custom", you will be able to select where you would want to have your Software Development Kit (SDK) and whether you want to have your Virtual Device set up right away.
Tip: Avoid using a long, non-ASCII location path for Android SDK.
We're almost there! Now, Android Studio will download all the required files. When that is done, click "Finish". Congrats: you have successfully installed Android Studio!
After opening the IDE, you will be greeted by the Start screen:
Here, you can see the most commonly used features of this screen. You can create a new Android Studio project by pressing the corresponding button, or open an existing project from your computer. Also, by pressing the "Customize" button you will be able to quickly access the IDE font and theme settings. You can also find the link to all settings in this tab:
Setting up your first project
Let's create a new project and see what the main window looks like:
Here, you need to select a project template. You can choose from various templates for any type of Android device: phones, tablets, wearable devices, TVs, Auto. Right now, we just want to create an app for an Android device. Click on the Empty Views Activity and press "Next".
Empty Activity and Empty Views Activity are not the same. Using Empty Activity results in creating a project with Compose, while Empty Views Activity is a project with XML.
Compose and XML are both ways to build user interfaces in Android. Compose is a newer toolkit introduced by Google that simplifies the process and speeds it up. It makes use of the Composite pattern and declarative programming. XML, on the other hand, uses XML markup language to define UI elements and their properties and requires a separate XML layout file for each screen or layout. This course focuses on XML toolkit, but you will be able to learn Compose in another course on Hyperskill.
Choose a name for your project. Then, set the project saving location and the programming language for your app. Enter your company or your nickname in the "Package name" field. Usually, it looks like "domain.companyname.appname".
After that, you need to choose the minimum SDK version that your app will support. Choose wisely: do not select the most recent or a very old version of Android. Really old versions are hard to maintain and have fewer users, and brand new versions also have a limited number of users. Play around with different SDK versions and pay attention to the percentage of devices that will be able to run your app. As of 2023, the best option is probably API 26 and higher.
Click "Finish". Congratulations, you have successfully created your project! Android Studio will build your project and you will see the Main window:
Project overview
At first sight, this might look a little confusing, but don't worry: you'll figure it out step by step.
On the left side, you can see your Project View. It gives you quick access to your resources, code, and build files. Your code is located in the "java" folder, and your project assets such as pictures, icons, fonts, and texts are located in the "res" folder. If you don't want to be distracted from your code, you can always hide your Project Structure by clicking the "Project" button on the left sidebar.
On the right side, you will see your open files. This is called the Editor window. You can switch between your files in the navigation bar.
At the top, you can see the path to the file you've opened and a toolbar. Toolbar lets you do a whole variety of actions such as building, debugging, and running your app. It also has a lot of useful Android tools that will help you in the development process later on.
Look at all these buttons all around your IDE's window: these are the tools that give you access to specific tasks like search, version control, device files, and more. The most used ones are "Logcat", "TODO", and "Terminal".
The status bar is located at the bottom. There, you can see the status of your IDE and project. All warnings, hints, and messages are shown in the status bar.
To learn more about Android Studio you can check out the Android Studio Tool Windows topic.
Conclusion
In this topic, we have covered in great detail how to install the IDE and create a project. You know what the main screen looks like and have a basic understanding of the Studio features. Now that you are familiar with Android Studio, you can start developing your own apps!