Android has become the most widely used operating system in the world. It already has almost 4.000 billion users worldwide, which is a real sensation. In addition, the mobile operating system developed by Google and based on the Linux kernel has also attracted a huge number of developers. If you want to be one of them, here We introduce you to Android Studio.
With this work suite for developers you will be able to create your first apps compatible with the system and test its operation, whether it is a video game, a utility, or even a client app for your IoT projects, etc. The positive thing is that Android Studio is also available for Linux, so you can work from your distro without any problem.
What is Android Studio?
Android Studio is the integrated development environment (IDE) official tool for creating applications for Android devices. It is an essential tool for any developer who wants to create apps for smartphones, tablets, wearables and other devices that use the Android operating system.
Based on IntelliJ IDEA, Android Studio offers a complete set of tools that facilitate the application development process, from creating the user interface to compiling and deploying the app to a physical device or emulator. Among its Principal functions are:
- Smart code editor: with auto-completion, refactoring, and static code analysis to improve productivity.
- Support for multiple programming languages: In addition to Java and Kotlin, you can use C++ to develop specific parts of your app.
- Visual designer: to create user interfaces (GUI) quickly and easily.
- Android emulator: to test your apps on different virtual devices among the most popular ones and with different versions of Android to test compatibility.
- Gradle Integration: A flexible build system for managing dependencies and setting build options.
- Wide range of templates and samples: especially interesting for beginners or those who want to create an app quickly with this help.
- Integration with Google Play Console: to manage the publication and distribution of your apps.
What can you do with Android Studio?
Now that you know what it is, and what functions it brings to developers, you should also know What you can do with Android Studio, or what you can use it for, well, here is a list of possibilities:
- Creating user interfaces: allows you to design the GUI of an app in a simple and visual way, or also using XML code. You can customize the appearance with a multitude of themes and styles, scale them to adapt to different screen sizes, etc.
- Writing efficient code: allows you to use the Java and Kotlin programming languages to develop the logic of your app, that is, create a utility to perform a task X or a video game. Thanks to its tools, it will allow you to easily take advantage of the libraries available for Android, as well as giving access to the management of hardware resources, such as network access, storage, interaction with sensors, touch screen, etc.
- Debugging and testing your application: Thanks to the integrated debugger, you can identify and correct errors in your code, thus avoiding possible bugs or vulnerabilities that affect your future app before launching it on Google Play or independently on the official store. On the other hand, emulators for different devices, configurations, and versions allow you to test your app in a variety of scenarios.
- Optimize performance: Other features include identifying potential issues that slow down the app and improving areas that affect performance. Not only that, you have profiling tools at your disposal to reduce memory usage and battery consumption.
- Get your app: Once you complete the process, it allows you to create an APK package to distribute and install your app, as well as allowing you to manage the different versions and updates that you may release in the future. And, of course, it also allows you to publish your app directly on Google Play so that it is available to everyone.
How to install Android Studio on Linux
Installation on MacOS, ChromeOS and Windows is simple, so I'm going to focus on the installation on Linux, which is perhaps the one that generates the most doubts. But before starting with the steps, you should know what they are. hardware requirements recommended to be able to install this IDE:
- CPU: x86-64 AMD or Intel supporting Intel VT and AMD-V virtualization technologies, as well as SSSE3 extensions.
- RAM: A minimum of 8 GB, but 16 GB or more is recommended.
- Storage: You must have free HDD/SSD space of at least 8GB or more.
- Screen: supports resolutions of at least 1280×800 px or 1920×1080 px.
If you don't have certain libraries installed, you may also need to install some of the 32-bit libraries, For example:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386 sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
If you meet these requirements, you should know that Android Studio is compatible with many 64-bit GNU/Linux distros, and works well on both KDE Plasma and GNOME. Now, the Steps to install Android Studio are:
- Access the official website of android studio downloads.
- Press the download button to start the download.
- After that, you should have a .tar.gz file in the location where you downloaded it.
- Copy that file into /usr/local/ if you're the only one using it, or into /opt/ if you want it to be available to multiple users on the system.
- Once copied there, you can unpack the contents of the tarball.
- Now, from the terminal, go to the directory where you extracted it.
- From there, go to android-studio/bin/.
- Then run the script inside it for the installation with the command «sudo ./studio.sh» without quotes.
- Then it's a matter of following the Setup Wizard installation and downloading components, which will also install the Android SDK, among others.
And that's it, you should now have the icon available among your apps so you can double-click on it and run it…
First steps to create your app
Now that you have Android Studio installed on your system, the next thing will be set it up and take the first steps as I show you here:
- Run Android Studio.
- On the welcome screen select Settings.
- Within the configuration menu click on Default Project.
- And within this new screen, choose Project Structure.
- Once there, you need to choose SDKs in the left panel and click on +.
- This will allow you to select the configuration you want in your case, such as JDK (Java SDK) for Java and the Android platform or version you want to develop your app for. This will use these default settings for your future projects, but you can change them at any time.
- Once this is done, go back to the Android Studio welcome screen, and click on New Project.
- This will start a New Project Wizard.
- It will ask you to fill out a series of information about your app, such as the name it will have, the name it will have in Google Play, package name, ID, project location (directory where you want it to be), SDK, etc. This will depend on each case. Once finished, click Next.
- On the next screen of the wizard you will need to customize the icon that your app will have. When you finish, click Next.
- For example, you can now select an Activity directory of your choice, such as Blank Activity, which will produce a simple example “Hello World” app. Click Next.
- Once you've filled out the configuration parameters for your first project, you can click Finish. Android will then build your project structure. Note that it will take longer the first time because it has to download Gradle (it only does this the first time).
- The project will then open and you can see what it looks like. Basically you have a navigation menu on the left (don't be scared by the overwhelming amount of files, you won't have to edit all of them, just the ones marked in red), the Java source code in the middle, and on the right a screen of the Android device showing the result.
- At this point, you can start adding or modifying the source code and add whatever you need for the GUI, use the different tools it offers, try running it to see if it works on emulators, create the .apk, etc.
add plugins
By the way, Android Studio also allows add plugins that can extend your capabilities or make your work easier. From some that allow you to customize the look and feel of the editor, to others that allow you to navigate your code more easily, add ADB commands, learn keyboard shortcuts, automatically generate Java classes from JSON, etc. If you want to explore and use these plugins from the official JetBrains Marketplace repository, follow these steps:
- Open Android Studio.
- Go to File > Settings > Plugins.
- Click the Browse Repositories button.
- Find the plugin you want to install.
- Click Install.
I hope you found this helpful and that you start creating great Android apps. We will also be publishing articles on how to code in the future, so stay tuned to the blog…