Apple and Google both make available to their users a universe made up of applications to download, now suitable for every need. If it's true that such a well-stocked catalog is to the advantage of consumers, not everyone knows what lies beyond the barricade. Yes, because for apps that are so different and peculiar in nature, there are just as many developers who are committed to shaping them. On Android, in particular, it's possible to develop using one of the tools of choice in this sense.
We refer to Android Studio, namely an integrated development environment dedicated to the creation of Android applications, the so-called IDE, integrated development environment in English, available at no cost and under Apache 2.0 license, based on Java language. The program is fully compatible with Windows, Linux and macOS devices, and now we will see together how to install it and how to use it at its best.
Why develop on Android
Before discovering all the secrets of Android Studio, it is good to understand why develop on Android. The first reason is fundamental and rhymes with necessity, the mother of invention. In fact, it could happen that, once we've consulted the Google Play Store, the app of our dreams isn't there, or that could perform the functions we need. In the same way, the push could come from the community, developing something useful and making it available for free as open source. Not only that, for some it could be an "excuse" to learn something new, particularly programming on Java, and for others an alternative way to monetize.
In conclusion, there are developers who create apps to promote or complement another existing product or service. These are known as companion apps, which are very common in the video game universe. Whatever the reason, developing one or more apps will challenge our design, technical and logical skills. And the result of this exercise, a perfectly functioning and useful application for Android, can only prove to be a winning weapon from a business perspective, as an attractive business card in our eventual portfolio.
Android Studio: what is it
As already mentioned, Android Studio is a development environment for creating applications on the Android operating system. It integrates an IDE editor with a visual layout, and to use it properly you need to know the Java language. Among professionals and amateurs, it is considered the official tool for creating applications for the operating system of the same name. The download, absolutely free of cost, is available for different platforms and for a bit all the main operating systems in circulation, such as Windows, Linux and macOS. With its release, Google wanted to replace the previous Eclipse, providing developers with a significantly improved development environment, both in terms of functionality and efficiency in developing applications. Android Studio is the leading tool for developing software for the Mountain View giant's mobile operating system. It derives from JetBrains' IntelliJ, an IDE for the Java world that is particularly sensitive to developers' needs. Inside it, however, we also find Gradle, a really good tool designed for all needs related to build automation, particularly flexible and enriched with all those features that in the past have made great predecessors such as Apache Ant and Maven. This translates into the ability to create variant and multiple APKs, as well as the presence of several elements for capturing performance, version compatibility, usability and issues of various kinds.
Of course, there is ample support for Google services, since it is a development tool made directly by the technicians of Big G, as well as a layout environment with editing theme quite productive. Android Studio also supports Google Cloud Platform, which facilitates the integration with Google Cloud Messaging and App Engine, while closing the package we find the ProGuard Software and pp signing.
How to install Android Studio
At this point, having put on the plate the purely technical aspects, we can and must devote ourselves to how to install Android Studio, so as to begin immediately to familiarize with its layout and all the tools available to those who want to develop applications for Android. As we mentioned in the previous paragraphs, Google has made it available to everyone, whether they are budding developers or real professionals, for free. You can download it at no cost on the official Developer Android page. Following a rather simple procedure. If we want to download on a Windows PC, for example, on the home page of the Developer Android portal we have to click on the words Download Android Studio and double-tap on the icon that has just been downloaded.
Doing so, let's remember to leave the boxes Android Virtual Device and Android SDK ticked, and click on "Agree", accepting all the points of the Android license. Then we click on "Instal the latest version Android SDK": the installation package will open, so wait a few minutes for the download to finish. If we have done all the steps correctly, the Google developer tool will be installed on our PC. The items included in the download are, of course, the Android Studio software, the latest version of the Android platform with which to compile the app, the latest version of the Android system image to run the app in the emulator, and finally Android SDKs, with which to organize, process, test and debug the apps. Be careful, though, because before downloading, you need to download the latest version of the Java Se Development Kit software to your computer, directly from the Oracle website.
How to use Android Studio
When you start Android Studio, the IDE shows a welcome window. On the left, you'll notice a list of recently opened projects, while on the right is a menu that allows you to start work in different modes. To start developing our Android app, let's select "Start a new Android Studio project". This will start a project creation wizard, divided into two screens. The first of these allows you to choose the type of application. First of all, let's define the application context between Phone and Tablet, Wear OS, TV, Android Auto and Android Things. Each of these is associated with various basic templates, such as Empty Activity, the one mainly used to start an application from scratch.
The second screen is instead useful to configure our project by choosing all aspects, from the name of the app to the package, including the location in the file system of the development machine, the programming language between Java and Kotlin and the minimum version of the Android API to be supported.
Completed the procedure indicated, Android Studio will return a simple project, but already fully functional. The project has a precise initial structure, made up of three main parts: the Java code folder, the res folder (containing resources mostly made in XML) and a configuration file known as AndroidManifest.xml. In turn, the entire project is contained in a folder called app, in fact the default module. This is particularly important, as the IDE splits a project into multiple modules, each of which can play a different role, such as the Java library, the Android library, and the inclusion of an external project. As a result, the app module includes manifest files, Java code and resources.
Next to the module, in Android Studio we find the Gradle Scripts section, a virtual home to the build files that Gradle will use to turn our project into a fully functional application. Going into detail, the build files available are two, one for the whole project and one for the app module only. An important aspect that should not be forgotten is that, as soon as you make a change to the build file, you must select the "Sync Project with Gradle files" button, available in the toolbar. You can recognize it by the elephant-shaped icon with a blue arrow, in the File menu and in the notification that Android Studio proposes as soon as something is modified in a Gradle file.
We would like to point out that in the Tools menu there are the items AVD Manager and SDK Manager. The first one, as the name suggests, activates Android SDK Manager, while the other one activates Android Virtual Device Manager. With Android SDK Manager we can integrate our SDK with additional features and updates, while Android Virtual Device Manager allows us to create one or more emulators, in case we don't want or can't run our projects on a hardware. A last and significant aspect of Android Studio is the layout preview, instantly available. The contents are in fact shown in Design mode, the typically visual one, or Text, which shows the typical XML format. What's more, there are some drop-down menus that allow you to change the preview conditions in terms of model, orientation and available Android version.