How to set up smartphones and PCs. Informational portal
  • home
  • Windows 8
  • Installing Android Studio, setting up the SDK. The dialogue looks like this

Installing Android Studio, setting up the SDK. The dialogue looks like this

This article will tell you how to install Android Studio, for this you will need the Java package already installed, if you have not installed it yet, please read. It will also talk about configuring the first time you launch and update the Android SDK packages.

Download Android Studio Package

Most of the work involved in developing Android applications will be done using the Android Studio environment. It can be downloaded from the page: http://developer.android.com/sdk/index.html. Under the heading "Other Download Options" is a list of packages for different platforms.

Before starting the download, you will need to agree to the license agreement.


Installing Android Studio

The installation process is different for different operating systems. Below are instructions for Windows, Mac OS X, Linux.

Installation under Windows

Run the downloaded exe-file, the installation wizard will open with standard steps like the installation location and the license agreement, after which a button will appear to start the installation process. Nothing complicated.



Also, the installation of other components such as SDK Manager and Android Virtual Device will be immediately offered. Check them out, we'll need them all.


If the version of the operating system allows, Android Studio can be launched from the Start menu. In the case of Windows 8, the launch occurs using an executable file in the bin folder of the environment installation directory, by default the path to it looks like this C: \ Program Files \ Android \ Android Studio \ bin. The method is not the most convenient, but you can always move this file to the taskbar. Please note that different versions of exe-files for 32-bit and 64-bit systems may be present at the same time.

Installation under Mac OS X

Android Studio for MAC OS X boots as a disk image (.dmg) file. Double click on it, a window will appear:


To install a package, simply drag and drop the Android Studio icon onto your Applications folder. The package will be installed in the Applications folder of the system, and the process usually takes a few minutes.

To launch Android Studio, locate the executable file in the Applications folder and double-click on it. An error dialog box may appear indicating that the JVM could not be found. If you get such an error, you need to download and install the JRE package for Mac OS X Java. It can be downloaded from the Apple website at http://support.apple.com/kb/DL1572. After that, the error should no longer appear.

To further facilitate access to the tool, drag the Android Studio icon from the Finder window and onto the Dock.

Linux installation

After downloading the package, go to the terminal in the folder where Android Studio should be installed and run the following command:

Unzip / / android-studio-ide- -linux.zip

Note that the Android Studio bundle will be installed in a subdirectory named android-studio.

To start the IDE, open a terminal window, change the directory to android-studio / bin and run the following command:

./studio.sh

Setting up Android Studio for the first time

When you launch Android Studio for the first time, a dialog box will appear giving you the option to import settings from a previous version of Android Studio. If you have settings from a previous version and would like to import them into a new installation, select the appropriate option and specify the location of the settings. Otherwise, indicate that you do not need to import the previous settings and click on the OK button to continue.

After Android Studio finishes downloading, the installation wizard appears as in the picture below.


Click on the "Next" button, select the standard installation and click on the "Next" button again, accept the license agreements and click on the "Finish" button to complete the installation process. The Android Studio welcome screen will appear.


Installing the latest Android SDKs

Before that we have already installed Java, IDE for Android and a set of the current Android SDK packages supplied by default. Before proceeding, it's worth taking some time to check which packages are installed and install the missing packages. This can be done using the Android SDK Manager, which can be launched from within Android Studio via Configure -> SDK Manager or from the welcome window at startup.


In the Android SDK Manager, make sure the check boxes in the Status column are checked for the following packages:

  • Tools> Android SDK Tools
  • Tools> Android SDK Platform-tools
  • Tools> Android SDK Build-tools
  • SDK Platform (most recent version)> SDK Platform
  • SDK Platform (most recent version)> ARM EABI v7a System Image
  • Extras -> Android Support Repository
  • Extras> Android Support Library
  • Extras -> Google Repository
  • Extras -> Google USB Driver (Required on Windows systems only)
  • Extras> Intel x86 Emulator Accelerator (HAXM installer)

If any of the above packages are not installed (the Status column is Not Installed), just check the boxes opposite them and click on the Install packages button to start the installation process. In the dialog box that appears, accept the terms of the license agreement, click the Install button, after which the SDK Manager will start downloading and installing the marked packages. During installation, an indicator indicating the installation status will be displayed at the bottom of the manager window.

Conclusion

This completes the installation of Android Studio, and we will finish preparing for the development of applications for Android.

In order to write applications for the Android OS, you need to install the Android Studio development environment (hereinafter AS). Why exactly AS and not Eclipse, you ask? The Eclipse IDE is much faster and weighs less than Android Studio.

but Google "recommends" to use AS, since in the future it will stop (or rather already) stopped supporting it. Android Studio is the future, so to speak. You must have a sufficiently powerful computer, preferably x64 bit, since AS uses about 3 GB of RAM, add here another 3 GB for the android device emulator ... My PC has win 8.1 pro x64, dual-core Intel 3.3 GHz processor, with 8 GB of RAM and I feel quite free ...

We go to the official website at the link https://developer.android.com/studio, download the latest version of the required bit depth. As of today, the current version is android-studio-2-1-2,

it will weigh approximately 1.2 GB. So please be patient if you have slow internet.

After downloading, launch the android-studio-2-1-2.exe installer,

the installation wizard will prompt you to determine the composition of the installation step by step,

accept the license,

choose an installation location,

We are waiting for the installation to finish again.

After that, run Android Studio from the desktop, or from the menu,

and click the Configure button to configure the SDK. You will see a list of installed android versions,

under which you can create applications, it is desirable that they were all. If some versions are not installed, then click on the link Launch Standalone SDK Manager to install and update packages.

The SDK manager will open,

put a tick on the items that are necessary, how to find out which ones? Manager SDK It will help you with this by checking the required version packages. Then click on the button in the lower right corner that says Instal 1 (1..100) package ..

In your case, the number of packages will be different. If you personally, or the place where you live, is under "Western sanctions", then to update the packages, go to the menu Tools-> Options ...,

where you can specify the address and port of the proxy server,

Hello everyone. We recently started to study the android application development environment and are trying to set up and create our first application that will work on an android smartphone or tablet. We have already written several topics for users, the first of which was "", in the second topic, we wrote about "", and in the third part of our description, "" was produced. Today we will create a new project and create a new emulator that we will use to test our application. At the start of execution, we will record everything for you and add pictures with detailed descriptions. If I am doing something wrong or something else, you correct me in the comments below.

Launch the Android Studio application and select the topmost item called "Start a new Android Studio project" and wait for the next window to appear. A new dialog box should open in front of you, where you need to name your application and specify your site. If there is no site, you can specify any other one you like. Why google it, I can't know, but it needs to be done.

After you enter a name for your work and specify a site, at the bottom you will see your site and application name in a mirror image. The last field shows you the path to install or save your work. Click on the "Next" button and you will automatically be taken to a new page where you need to select the android version. Yes, this is exactly what we did in the second part of the program setup. You need to select android, the version of which is 4.0 and 4.4. Since a large number of people use such devices. If you seem to be devices with android 5.0 and 6, other users will not be able to use your application due to incompatibility. Select a device and click on the Next button.

The next dialog box shows us a list of ready-made templates. I choose the Blank Activity template, the other at the very beginning is not even worth touching, since I need to deal with the most basic. When we learn the basics, then we can do something else. Select a template and click on Next.

In the window that you see above, I leave everything by default and don't change anything, just click on the Finish button. After that, the program Android Studio will start building the application automatically, you need to give it some time to create this project.

Development environment. launched and ready for the next work with it.

In order to start working in the program you need to create. I would like to inform you that working with the emulator, which is built into the program, will consume a lot of energy. This means that you will definitely not be able to work with several programs at once. Freezes and long loading times are possible, but no need to worry. Now let's get down to creating an emulator.

In the upper part of the program, a very convenient navigation has been created, everything is beautiful and convenient. Open the Tools tab at the top of your program and go down to Android and select AVD Maneger.

A new dialog box should open in front of you, in which there is a list of emulators available to you. This list may not be in all. In order to create a new emulator, click on the "Create Virtual Device" button. After that, a new page will appear in front of you.

On the new page, you are presented with a list of available devices, you should not choose a device with a high screen resolution, as its load will double, you will have to wait a lot of time and it will not be convenient to work. Therefore, I choose the Nexus One device and its resolution is 480 x 800.

After that, click on the Next button. after that you need to select android version, don't make the latest android version. This will slow down the loading speed of your emulator and may not start at all. I choose 4.2 cream sandwich. and click on. It will take some time to create the emulator, in my case it took 10 minutes.

All our emulator is created, let's check it out. To do this, go to the section with your emulators. If you have forgotten where it is, then go up and look at the instructions. In the window that appears, select your created device and click on the green arrow, which is located on the right side of the screen.

Click and wait for your emulator to load, this is a very long process, do not touch anything, just wait for it to appear. When the emulator appears, it will start loading the android system. Everything is exactly like on the phone, or rather, when it is loaded. What should be the result? An additional window with a cell phone image should open in front of you.

On the splash screen of this cell phone, we see the inscription android. This means that the system is loading, wait for the desktop to appear like on your smartphone. This will also take some time, it took me 7 minutes, the first launch I had about 15 minutes. Do not panic, wait and you will succeed.

All the necessary functions and buttons work on this smartphone, I checked. You can also check by flipping through your new smartphone. This concludes our lesson, thanks for your attention. If you have questions or have something to add, we are waiting for your comments below.

Starting to master development for any platform, you will surely immediately stumble upon a lot of invisible pitfalls at first glance. Most of them will be related to the coding process itself: inconsistencies in the API, hidden functions, restrictions, a special style of programming for the platform. There are also stones that lie a little further away: testing and automatic optimization, creating clipart and icons, receiving automatic crash reports. Inexperienced Android developers run the risk of hitting both feet on them.

In this article, we'll explore the challenges of Android development in the context of utilities and tools. We will get rid of the need to connect a smartphone using a cable during testing and debugging on the device, split the application into Lite and Pro versions, build a mechanism for automatic generation and sending of crash reports to the server, automate testing, obfuscate and optimize the code, as well as in a few minutes we will create an icon for the application and all the necessary resources. Go.

1. Slow emulator

So, you've sketched your first application, and it's time to launch it and test it to work. For this, the Android SDK includes an emulator. For a long time it was reproached for its slowness, but with the release of Android Studio 2.0 the situation has improved a lot - the x86 version of the emulator has received hardware acceleration, so that now it works faster than real devices. In addition, it has a user-friendly graphical interface with which you can simulate calls, SMS, change GPS data and network failures, that is, everything for which you had to use command line tools before.

So if you haven't upgraded yet, I highly recommend doing so, let alone migrating from Eclipse. And be sure to select the x86 version of the emulator in the AVD manager, the ARM version does not support hardware acceleration.

2. Smartphone on a leash

The second stage is testing on a real device. Everything is simple here: you connect your smartphone via USB, install the drivers, turn on the debugging mode in the developer settings, after which the device appears in the list of applications available for installation (next to the emulator). The only problem is that in this case the device must be kept connected to the PC using a cable, and if this is your main smartphone, which receives calls and messages, then there is no need to talk about convenience.

Fortunately, Android Studio (or rather, the ADB utility it uses to communicate with the device) is network friendly. But this function still needs to be activated. If you have a rooted smartphone, you're in luck: you can enable network debugging using the WiFi ADB app. Sequencing:

  1. Install WiFi ADB, launch it, turn on the network mode using the switch and remember the IP address.
  2. Launch Android Studio.
  3. Open the console, go to the directory with the installed SDK, then to platform-tools and run the following command:

    $ adb connect ip address

Now, if you try to build and run the application, you will see your smartphone in the list of devices as well. Those who do not have root can restart ADB in network mode by first connecting it with a cable. This is done like this:

  1. We connect the smartphone and install the drivers.
  2. Turn on debug mode in the developer settings.
  3. Open the console, go to the SDK / platform-tools directory and run the following command:

    $ adb tcpip 5555

  4. We connect to the smartphone over the network:

    $ adb connect ip address

The IP address can be found through the settings: "About the phone (About the tablet) → General information", item "IP address".

3. Libraries

Okay, your stub that was thrown in half an hour seems to be working, and it's time to turn it into a real application with a beautiful interface and widgets for your desktop. At this stage, you probably need external libraries that implement various interface concepts, programming patterns, and communication with external services. And if everything is clear with the latter (you need an SDK for Dropbox - you open the portal for developers and follow the instructions), then with the rest it is already more difficult. Where to find them and which libraries are better?

The most complete library catalog is Android Arsenal. There you will find almost everything you need. Convenient search and sorting by rating are available, for each library there is an instruction on how to connect it to your project, including using the standard Android Gradle build system: just add the repository to the project's build.gradle file and specify the library in the list of dependencies.


You can find an excellent list of must have libraries on this page. From myself I will add that in the first stages it is worthwhile to immediately study Dagger 2, RxJava and Retrofit... As an advanced developer, you will come to use these libraries one way or another.

4. Icons and clipart

Finally, after days or weeks, a full-fledged application begins to emerge. But there is still no graphic material: the icon is standard, in the form of a green robot, instead of a clip art, there are stubs. Obviously, it is pointless to go to the markets without graphics, however, paying for an icon for your first application is also stupid. What to do?

In fact, the icon can be generated. There is a wonderful web service Android Asset Studio, with which in just a couple of minutes you will get a beautiful icon in all possible resolutions. As a basis, you can take a picture you have prepared, just write a text or, what is best, choose from the clipart provided by the service. Also you can set the icon style (round, square, iOS style ...), color, adjust shadows and other parameters. As a result, you will have the ic_launcher.zip archive at your disposal, which must be expanded into the AndroidstudioProjects / APPLICATION_NAME / app / src / main / res directory. Be sure to create a web icon by clicking on the "Generate web icon" button. You will need it.


The same service allows you to create icons for the ActionBar and the status bar. The principle is about the same, I will just say that icons with a 15% margin from the edges look best in the status bar.

In addition, you will need a so-called Feature Image. This is a special picture that Play Market and other app stores use as a plate at the top of the screen (when you open the app page on a smartphone). It can be generated using another service. To make screenshots, you can use the official service from Google. It creates a smartphone frame around the screenshot.

5. Crash reports

The application is ready, the icon is there, the interface is convenient, the code is high-quality. It's time for testing, and the first thing you do is send the application to your friends and acquaintances. But here's the bad luck: for some of them the application crashes, but everything works fine for you, and you cannot repeat the actions that led to the crash. What to do, ask your friends to send you a logcat listing?

No, we need a crash reporting system. There are a huge number of such, and they all implement the same principle of operation: a small library is connected to the application, which at the time of the fall records the stack trace and other data about the fall and sends them to the server, and then a special web interface forms beautiful and visual reports.

One of the most popular such systems is Fabric, but I recommend looking towards Splunk MINT: it is free, simple and easy to integrate into the application (just add one line of code). To start using it, you need to connect the SDK to the project, you can do this using the same Gradle. Open the build.gradle file (the one related to the application, not the whole project) and add the following lines:

Repositories (maven (url "https://mint.splunk.com/gradle/")) dependencies (compile "com.splunk.mint:mint:5.0.0")


After that Splunk MINT will show you a line of code that needs to be inserted into the code:

Continuation is available only to subscribers

Option 1. Subscribe to "Hacker" to read all materials on the site

Subscription will allow you to read ALL paid materials on the site within the specified period. We accept payments by bank cards, electronic money and transfers from the accounts of mobile operators.

Top related articles