It is praised for its versatility, ease of use and number of tools, and is sometimes criticized for its curiosity bugs and common mistakes, Studio for Android it has already been area of development widely used when creating green android app applications.
But once you get here, you may not yet – yet – you are one of the many developers who have already used it Studio for Android to make your Android apps. Although there is something that tells me that your idea is to start familiarizing yourself with the whole secret of this IDE – Integrated Environment Compilation, so that it can be explained in English.
And that is exactly what our mission is in this guide: tells you everything you need to know to get started with Android Studio. From its download and installation, to creating your first app.
What is an Android Studio?
As with any other area of development, Android Studio is a software that includes the necessary resources and tools engineer to know it create new programs. Although they exist IDEs such as Microsoft Visual Studio enabled create plans for different platforms, Android Studio is designed for the development of Android applications – and, for the most part, and on ChromeOS.
Android Studio maintains similarities with other areas of development. For example, it provides the tools needed for both make sense – code-as for interface design app. It also includes a compiler, based on Gradle, and the IDE itself is derived IntelliJ IDEA.
IntelliJ IDEA and Gradle, what?
Gradle is the default integration tool open source, which represents its flexibility. It can be used to build almost any type of software, regardless of which platform it is designed for.
IntelliJ IDEA is a development environment used by Android Studio as a base. So, in addition to IntelliJ's own tools such as code coding that performs functions such as auto-coding, duplicate detection, cross-language replication and more, Google adds many other features that we wouldn't find in the original version of this IDE
Certainly Android Studio is a platform development platform, and it is possible to use it on Windows, MacOS, Linux and ChromeOS. In addition, the IDE provides the opportunity to write code to it Kotlin and Java, although thanks to the Android NDK option you can support languages like C or C ++.
There is also a lack of integration of variants Version controlsthe commentator APK files, emulator, and more to see on the official website of development.
How to install Android Studio on your PC, MacOS or Linux computer
I've said it before Android Studio is a cross IDE. This: has many versions of them large desktop platforms, including Windows, Linux, macOS, and of course, ChromeOS. Depending on your device's app, installation steps are different. But whatever that is, the first thing will be Download Android Studio from the official website.
Install Android Studio on Windows
-
Use the ".exe" file to download it by double clicking on it
-
Check the "Android SDK" and "Android Virtual Device" options if available
-
Follow the steps of the installation wizard, in which case you will need to select the path where the program should be installed, check for updates or select items to install.
Install Android Studio on MacOS
-
Run the ".dmg" file you downloaded by double clicking on it
-
In the ".dmg" file window, drag the Android Studio icon to the "Applications" folder on your computer
-
Double-click the Android Studio icon in the Apps folder
-
Follow the steps of the installation wizard
Install Android Studio on Linux
-
Open the .zip file you downloaded the way you want
-
Open the Terminal window, then go to the "android-studio / bin /" path, to later use the "studio.sh" file
-
Follow the steps of the installation wizard
-
If you want the Android Studio icon to appear in the list of installed apps, within the Android Studio click on the "Tools" menu and select "Create Desktop Access"
4 things to do with Android Studio
Now You have already installed Android Studio and are ready to work on your computer – It wasn't that hard, did it? -. With an already configured IDE, the only thing left for you to start using is started: create apps.
Create your first app
Although it is possible to use Android Studio for many other things, We'll start with the most obvious: create an app. Whether you have programming experience or not, creating an app is very easy if you follow the steps we suggest below, and allow guidance and recommendations that the IDE itself will provide. Don't wait until you finish reading this guide to create your own WhatsApp – today we are not here to teach you how to program – but you can take it as a starting point for the development of Android apps. Otherwise, we start:
1. Prepare your project
-
Open Android Studio and create a new project: to do this, open the app and, in the first window, click on "Start a new Android Studio project".
-
View and modify your project details: in the following window, Android Studio offers you the ability to modify some features of your application:
-
Function: According to official documents, the work is "the simplest and most concrete thing a user can do again
which contains a user interface. As you can see, Android Studio offers a variety of functions, separated by the type of device to be designed. -
Project Data: In this second screen, you can change the features such as the app name and package, the project location on our computer, and the other two most important details such as Java-Kotlin-, and the API level minimum required to run the application.
-
What minimum API level should you use? If you choose the old API level, the development process can be very complicated because some technologies will not support the smallest programming configuration, and if we choose the most recent one, users of older devices will NOT use our app – you now understand why Android data transfer is important. so for developers? –
-
Choose the language "Kotlin" and the minimum API level 23, which is compatible with Android 6 – to create an example app, your choice here is less important.
-
Click "Finish" to open Android Studio and start upgrading your app.
Why Kotlin? Although Android offers an opportunity to improve programming in Java, today Kotlin is already the programming language of choice for Google to develop apps on Android, and gradually the latest technical documentation focuses on using this language However, if you're familiar with Java, you can start using this one. the tongue. However, if your goal is to create Android apps, learning how to upgrade to Kotlin should be among your plans. Something has already become the fourth most popular language for developers at StackOverflow.
2. Get acquainted with the IDE interface
Once inside Android Studio, you will find an interface similar to other IDEs. On the left you will see a panel containing files and resources that builds your project, while the right-hand side is code editor. At the bottom, you will see a to comfort which will provide you with relevant information as you progress in your app development.
In the left panel, where the project files are, you will see various folders. Each of them includes files of different types. In this case, we need to look at two of them:
-
application / java / com.andro4all.appdetestHere are the files that include the logic – code – of the application. Initially, there will be a single MainAcaction.kt file, which will be our main class / function.
-
application / res / structure / function_main: the word "res" refers to "resources" – resources – and within it, the "properties" of the directory houses create application configuration files. Initially, there will be only one task_main.xml file, which contains the structure of our main function.
3. Start the program
A moment of truth is coming: touch provide our operating system. We will start by designing the main work interface. To do this:
-
Open the "function_main.xml" tab, or double-click the file if it was not open.
-
First you will see the design window, from there adding, modifying or deleting app icons. Click on the "Text" tab at the bottom left of the screen, where the workflow will be in the XML code. Any changes you make to the Layout tab will automatically be shown in this code.
In this step, we recommend that you try the various components and materials provided by Android. It's a good idea to use web design guidelines for Android developers.
- With our test app, we will create a simple design containing TextView and a Button type widget. The XML code you need – you can copy and paste it into your_main.xml file – the following:
- Now you must plan the use of our button. To do so, open the MainActivity.kt -or MainAcction.java file if you have selected java as your app's language, and enter the required code:
And that's it! With a few lines of code, you'll have made your own the first Android app. Very simple, but that works to learn more about the tools of the legal environment for developing our favorite app. And, if you wanted now, you could export APK file try the phone, share it with the world, or even publish it in the Google Play Store.
Use the Android emulator on your computer
Unless you decide not to install it during the initial installation process of Android Studio, The IDE includes the official emulator you can try on any kind of Android ever. While this emulator is primarily intended test the apps you are developing using Android Studio, can also be used test new features for each type of program, or do exercises you don't wish to do with your mobile phone. Although while we have discussed this with other actors in great detail, it is worth remembering the steps to take create and use an Android emulator installed in Android Studio:
-
Open Android Studio and, in the main window, click "Configure" to select the "AVD Manager" option
-
In the window to open, select the "Create virtual device" option
-
Select the features of your virtual device: screen size, device category, resolution… Then click “Next”
-
Choose the version of Android that will work. In this case you may have to download a compatible program image to continue
-
Name your device and finish setup
When the process is complete, the emulator will start automatically, and you can use a device that looks genuine. In addition, this will include additional tasks such as possible select the battery or network coverage of the phone, the format – vertical or horizontal – and many other features you can change. You can too install applications simply by dragging a .apk file into the emulator window.
Test your apps on a real device
Of course, if you have an Android phone nearby, you don't even need an emulator to test the programs you have set up using Android Studio. The IDE provides the opportunity to run apps on a real device, where it is sufficient to enable USB debugging, and follow these steps:
-
Open the Android Studio and install the project
-
Connect your phone to a computer with USB debugging enabled
-
In the top options bar, search for a list of available devices, and select the name of your actual device
-
Tap on the green "Play" icon to use the app on your device.
Find out how your favorite apps are made
However Android Studio is not the only place to build; It also helps to learn. Due to the thousands of open source projects available, it is possible analyze and use the work of other people and companies collect ideas, learn from advanced programming techniques that can be used later in your projects, or simply check how they work other popular apps available. In this example, we will use one of the best known open source Android applications available: The Telegraph.
Remember, of course, that this can't be done with all applications. While there are some helpful tools decompose .apk files to get your source codeSometimes the results are unexpected, especially since many companies and developers are using coding methods.
Ofus … what? In the field of software development, obfuscation refers to the process of deliberately encoding readings to prevent their performance being easily accessed by third parties, as well as in other projects.
So, our recommendation is, stop getting started, try open source projects. The catalog is full of apps open source his code is available for download by the F-Droid.
-
Enter the Telegraph code on GitHub and click the green "Clone or download" button to download the ZIP for all app code
-
Open Android Studio and, in the main window, select the option "Open Android Studio Project", then select the project folder you just downloaded.
-
Wait until the project uploads to Android Studio.
So, you can read, modify, copy and do what you want with the application code, to test later changes to a physical or virtual device, or to export a modified by the application for new tasks you have created for yourself.
Picture | Daniel Ricaros, Unsplash
Join our channel Phone day highlights and best Android deals!
Join our Telegraph Channel
Table of Contents