Installing Android Studio
Android Studio is the official IDE for Android app development. It provides the core tools needed to start developing Android apps, including Android Studio IDE and the Android SDK tools.
You can download Android Studio at http://developer.android.com/sdk/index.html. Your machine should have JDK (Java SE Development Kit) 6 or higher. If you are developing for Android 5.0+, you would need JDK 7+. JDK can be downloaded here.
Setup on Windows
To set up Android Studio on Windows, launch the .exe file and follow the setup wizard to install Android Studio and any necessary SDK tools. If you already have a copy of the SDK, choose Custom Install in the Install Type. In the SDK components uncheck SDK. You will be prompted to provide the directory where the SDK is. To access the Android SDK tools from the command line, navigate to the location where they are installed, e.g. \Users\\sdk\
Note: If the launcher script does not find where Java is installed, you need to set an environment variable indicating the correct location. To do this, select Start menu > Computer > System Properties > Advanced System Properties. Then open Advanced tab > Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder e.g. C:\Program Files\Java\jdk1.7.0_21.
Setup on Mac OS X
If you have a Mac OS X machine, launch the .dmg file and drag and drop Android Studio into the Applications folder. Open Android Studio and follow the setup wizard to install any necessary SDK tools. If you already have a copy of the SDK, choose Custom Install in the Install Type. In the SDK components uncheck SDK. You will be prompted to provide the directory where the SDK is. To access the Android SDK tools from the command line, navigate to /Users/Library/Android/sdk/
Note: If you see a warning when opening Android Studio that says the package is damaged and should be moved to the trash, go to System Preferences > Security & Privacy and under Allow applications downloaded from, select Anywhere. Then open Android Studio again.
Setup on Linux
On Linux, unpack the downloaded Android Studio ZIP file into your preferred location. To launch Android Studio, navigate to the android-studio/bin/ directory in a terminal and execute studio.sh. Follow the setup wizard to install the SDK and any necessary SDK tools. If you already have a copy of the SDK, choose Custom Install in the Install Type. In the SDK components uncheck SDK. You will be prompted to provide the directory where the SDK is.
Note: You may add android-studio/bin/ to your PATH environment variable so that you can start Android Studio from any directory. Note: You may also need to install the ia32-libs, lib32ncurses5-dev, and lib32stdc++6 packages to support 32-bit apps on a 64-bit machine.
Adding SDK Packages
After setting up Android Studio, you need to add SDK packages using the SDK Manager. To open the SDK Manager from Android Studio, select Tools > Android > SDK Manager or click SDK Manager icon
in the toolbar. You may need to click the “Launch Standalone SDK Manager” link to display the SDK Manager. On Windows, you can double-click the SDK Manager.exe file at the root of the Android SDK directory. On Mac or Linux, open a terminal and navigate to /tools directory, then execute android sdk
Download the following packages from the SDK manager:
- Tools: Android SDK Tools, Android SDK Platform-tools, Android SDK Build-tools (latest version)
- The latest Android (Android X.X) folder: SDK Platform, A System image for creating emulators: ARM EABI v7a System Image or Intel x86 Atom System Image, Samples for SDK (optional),Documentation (optional)
- Extras: Android Support Repository, Android Support Library, Google Repository (if you will be using Google Play Services APIs),Google Play services (if you will be using Google Play Services APIs)
You have now successfully installed Android Studio. It is now time to build awesome Android apps. If you are new to using Android Studio, you can check this DevByte video.
Name already in use
harrix.dev-blog-2019 / install-android-studio / install-android-studio.md
- Go to file T
- Go to line L
- Copy path
- Copy permalink
- Open with Desktop
- View raw
- Copy raw contents Copy raw contents
Copy raw contents
Copy raw contents
Установка Android Studio в Windows
В статье рассказывается, как установить Android Studio в Windows 10.
Настоятельно рекомендую устанавливать Android Studio на 64-битную Windows. На сайте Android Studio даже нет полноценного установщика на 32-битную версию. Раньше можно было архив скачать на 32-битную, но теперь и это не найти.
В идеале лучше использовать Windows 10 x64, но на Windows 8.1, 8, 7 тоже должно пойти.
Помните, что для Android Studio нужно минимум 8 Гб оперативной памяти (раньше было 2 Гб, а потом 4 Гб) и выше. Программа очень прожорливая. А на жестком диске нужно приличное количество места: после установки с эмулятором всё будет занимать от 15 Гб, а потом в процессе работы после установки библиотек и остального занимаемое место будет быстро расти.
Желательно иметь процессор от Intel, так как на процессорах AMD будут проблемы с эмуляторами Android. Но они решаемы.
И желательно, чтобы процессор имел поддержку виртуализации: сильно ускорит работу эмуляторов.
Если есть возможность и если пользователь на вашем компьютере называется по-русски, то поменяйте его на английское написание. Проблем с русскими именами будет много, причем не только в Android Studio. Очень много программ зарубежного производства рассчитаны на работу с файлами, в пути которых только латиница. Но если возможности нет для смены имени, то в статье будут описаны решения некоторых ваших проблем.
Если раньше нужно было самостоятельно устанавливать JDK, то теперь он устанавливается самостоятельно при установке Android Studio:
Рисунок 1 — Установленный JDK
Но если всё таки что-то пошло не так, то подробно об установке JDK можно узнать в статьях: Установка JDK в Windows или Установка OpenJDK в Windows .
Скачивание Android Studio
Нажимаем на кнопку скачивания:
Рисунок 2 — Кнопка скачивания Android Studio
Соглашаемся с лицензией, прокручивая её, и скачиваем:
Рисунок 3 — Скачивание установщика
Установка 64-битной Android Studio
Запускаем скаченный файл:
Рисунок 4 — Первое окно установки
Рисунок 5 — Выбор компонентов для установки
Раньше рекомендовал менять пути установки Android Studio, но теперь же, наоборот, рекомендую устанавливать всё туда, куда хочет Android Studio, так как на большинстве машин теперь всё работает по умолчанию хорошо. И в следующем окне установщика можем оставить всё, как есть:
Рисунок 6 — Изменение пути установки
Далее по умолчанию, или выберете, где в меню Пуск будет находиться Android Studio:
Рисунок 7 — Выбор папки в меню Пуск
И пошел процесс установки, в конце которой вы увидите окно окончания установки:
Рисунок 8 — Окончание установки
Рисунок 9 — Последнее окно программы установки
Установка предварительной сборки
Если хотите получить самую последнюю версию Android Studio с самыми последними нововведениями, то можно установить предварительную версию.
Рисунок 10 — Страница с предварительными версиями программы
Рисунок 11 — Соглашение с условиями
Скачается не установщик, а архив, который мы распаковываем. И в папке bin\ находится файл studio64.exe , который и запускаем:
Рисунок 12 — Файл Android Studio
Первоначальная настройка Android Studio
При первом запуске Android Studio нас попросят выставить некоторые настройки. Сперва появится это окно:
Рисунок 13 — Запрос на импорт настроек
Спросят об отправке статистики в Google (я обычно соглашаюсь):
Рисунок 14 — Запрос об отправке статистики
Рисунок 15 — Приветственное окно
Выбираем стандартную настройку параметров:
Рисунок 16 — Выбор типа настроек
Выбор светлой или темной темы:
Рисунок 17 — Выбор темы редактора
Если Android Studio не смог найти сам JDK, то нужно ему помочь его найти:
Рисунок 18 — Кнопка выбора пути к JDK
Рисунок 19 — Выбор пути к JDK
Рисунок 20 — Выбранный путь к JDK
Список того, что будет установлено:
Рисунок 21 — Окно перед установкой компонентов
Рисунок 22 — Процесс установки
Хорошо, если в окне окончания установки не будет красного текста, который свидетельствует о том, что что-то не установилось. Например, обладатели AMD процессоров, возможно, увидят сообщение, что не установился HAXM. Это будет означать, что стандартный эмулятор вы скорее всего нормально не запустите, но Android Studio будет работать полноценно. Если у вас появились другие сообщения об ошибках, то это плохо (гуглите).
Рисунок 23 — Окончание установки
Создание нового приложения
Теперь создадим новое приложение:
Рисунок 24 — Создание нового приложения
Выбираем болванку нашего приложения Empty Activity :
Рисунок 25 — Выбор типа активности проекта
Выберем настройки проекта:
Рисунок 26 — Настройки проекта
Внимание! В пути к проекту, как и в его названии, не должно быть русских букв и пробелов! По умолчанию Android Studio сохраняет проекты в папке пользователя компьютера. И если у вас пользователь написан русскими буквами, то ничего не запустится!
Поэтому рекомендую создать какую-нибудь папку, где будете располагать свои проекты. Например, у меня это папка C:\Users\sergi\OneDrive\Projects\Android .
Когда выберите папку для ваших проектов (у меня C:\Users\sergi\OneDrive\Projects\Android ), то придется вручную дописать название проекта в пути проекта, убирая пробелы из названия. Саму папку создавать не нужно: Android Studio создаст её сам. По итогу у меня получился путь C:\Users\sergi\OneDrive\Projects\Android\MyApplication . В последующие разы Android Studio будет создавать проекты по нормальному.
Также в этом окне выбираем язык Java как основной язык проекта (по умолчанию будет выбран Kotlin), минимальную версию Android, на котором будет запускаться приложение (версия 5.1 вполне сойдет).
И после кнопки Finish должно наконец-то появиться окно редактора Android Studio:
Рисунок 27 — Редактор Android Studio
Если надо, то закройте окно с подсказками:
Рисунок 28 — Окно с подсказками
В этот момент начнет работать Gradle, чтобы синхронизировать нужные библиотеки. И пока внизу не прекратиться крутиться кружок, то проект не готов к работе. Если у вас компьютер слабый, то крутиться кружок будет долго:
Рисунок 29 — Gradle синхронизирует проект
Внизу пропала полоса загрузки, а кнопка запуска приложения стала зеленой. Это означает, что всё прогрузилось:
Рисунок 30 — Gradle закончил синхронизацию проекта
Возможно (не обязательно) внизу появится сообщение об ошибке Install Tools . and sync project :
Рисунок 31 — Ситуация, когда не хватает пакетов SDK
Эту ошибку вы будете встречать часто, когда будете открывать чьи-то проекты программ на Android Studio, сделанных не на вашем компьютере. Бояться её не нужно: просто щелкните по этой синей надписи Install Tools . and sync project : Android Studio просто говорит, что ему нужны библиотеки SDK, которых нет у вас, и предлагает их скачать.
Для тех, у кого пользователь назван русскими буквами
Если у вас пользователь назван русскими буквами, то в предыдущем разделе столкнетесь с тем, что Gradle не синхронизирует проект, и вообще он на всё ругается. Дело в том, что по умолчанию Gradle в новых версиях Android Studio ставит в отдельную папку, которая находится в папке пользователя, который у вас написан по-русски.
Вам нужно поменять папку на другую. Создадите, например, папку C:\Android\gradle . Потом идите в настройки Android Studio:
Рисунок 32 — Настройки Android Studio
Там находим настройки Gradle. Видим, что Gradle сейчас находится в папке пользователя:
Рисунок 33 — Настройки Gradle
Меняем его на путь к папке, которую мы создали, например, это C:\Android\gradle :
Рисунок 34 — Путь к Gradle
Но после нажатия OK ничего не произойдет (иногда слетает светлая тема оформления). Нужно Gradle синхронизировать принудительно. Для этого наверху есть кнопка Sync Project with Gradle Files :
Рисунок 35 — Кнопка синхронизации проекта
И начнется небыстрый процесс скачивания и установки gradle в новую папку с последующей синхронизацией проекта:
Рисунок 36 — Кнопка синхронизации Gradle
Чтобы убедиться, что всё прошло хорошо, то можно посмотреть папку C:\Android\gradle , где должны появиться следующие папки:
Рисунок 37 — Переустановка Gradle
Если слетит тема оформления, то нужно её вернуть ( File → Settings. ):
Рисунок 38 — Выбор темы оформления
Надеялись, что всё установили? Нет, теперь нужно настроить SDK. Для этого из Android Studio нужно перейти в SDK Manager . Это можно сделать так:
Рисунок 39 — SDK Manager
В разделе SDK Platforms вы выбираете те версии Android, которые вам потребуются. Можно, например, выбрать последнюю и минимальную версию, под которой всё должно работать, как показано на скриншоте ниже:
Рисунок 40 — Выбор версий Android в SDK
В SDK tools выберете Google USB Driver (чтобы можно было подключать планшеты и смартфоны), Google Web Driver :
Рисунок 41 — Выбор инструментов SDK
Нажимаете на OK и начинается процесс установки:
Рисунок 42 — Информация, какие компоненты будут установлены
Рисунок 43 — Процесс установки
Рисунок 44 — Окончание установки
Рисунок 45 — Окончание установки
Создание виртуального устройства
Если у вас нет физического Android устройства, или же вы хотите своё приложение протестировать на конкретных устройствах с конкретной версией Android, то вам нужно будет виртуальное устройство.
Идем в AVD Manager :
Рисунок 46 — AVD Manager
Создаем новое виртуальное устройство:
Рисунок 47 — Создание нового виртуального устройства
Выбираем, какое устройство будем создавать. Допустим, мы хотим создать эмулятор Pixel 2 :
Рисунок 48 — Выбор устройства
Внимание! Важный шаг. Для эмулятора нужен образ версии Android, который будет устанавливаться на эмулятор. И вам нужно будет его скачать, нажав на Download . Например, нам нужен Android 10.0:
Рисунок 49 — Выбор версии Android
Рекомендую выбирать версию Android от 6 и выше. Например, выбирал однажды версию более низкой версии, но при попытке запуска приложений на эмуляторе возникала ошибка такого вида:
Рисунок 50 — Ошибка при запуске приложений
Обычно такая ошибка решается отключением Instant Run в настройках, но в тот раз не помогало. Так что еще раз рекомендую выбирать версию Android от 6 и выше (с ними у меня проблемы не возникли).
Если вы обладатель AMD процессора, то вполне вероятно, что образ Android x86 не заработает у вас, поэтому нужно выбирать (после неудачной попытки с образом x86) образ Android из другой вкладки под armeabi-v7a . Но сразу предупреждаю: если у вас эмулятор под armeabi заведется всё-таки, то работать он будет медленно, и было на практике много случаев, когда эмулятор потом так и не запускался:
Рисунок 51 — Выбор других образов для виртуального устройства
После нажатия на кнопку Download начнется скачивание образа:
Рисунок 52 — Скачивание образа
Возможно, что перед этим вас попросят согласиться с лицензией:
Рисунок 53 — Соглашение с лицензией
После этого образ Android будет доступен для выбора и можно продолжить создание виртуального устройства:
Рисунок 54 — Следующий шаг в создании эмулятора
Здесь всё можно оставить по умолчанию:
Рисунок 55 — Выбор настроек эмулятора
Попробуем запустить эмулятор:
Рисунок 56 — Запуск эмулятора
Если через какое-то время у вас в эмуляторе запустился полноценный Android, то всё замечательно:
Рисунок 57 — Запущенный эмулятор
Можно пока его не закрывать, так как будем его использовать для запуска нашего приложения. Но для будущего есть рекомендация: закрывать эмулятор лучше через крестик, а не через кнопку питания, которая находится чуть ниже: практика показывает, что при отключении питания потом эмулятор может не запуститься:
Рисунок 58 — Способ, как закрывать эмулятор
Если родной эмулятор от Android Studio не запускается или тормозит так, что работать нельзя, то можно попробовать сторонние эмуляторы, благо их много.
BlueStacks — известный эмулятор, предназначенный в первую очередь для запуска игр Android на ПК, но его можно использовать и для Android Studio.
Genymotion — по работе похож на родной эмулятор Android Studio. Можно устанавливать образы разных версий Android.
Nox — еще один популярный эмулятор от китайцев, которым лично много пользовался.
Теперь у нас Android установлен и настроен. В процессе мы создали приложение до этого. Давайте его запустим. Для этого щелкаем по зеленому треугольнику в панели инструментов:
Рисунок 59 — Запуск приложения
Или из главного меню вызвать такую же команду:
Рисунок 60 — Запуск приложения
Обратите внимание на то, что раньше в Android Studio после нажатия на кнопку запуска предлагалось выбрать устройство, на котором будет происходить запуск, то сейчас вначале нужно выбрать устройство в выпадающем меню слева от кнопки запуска:
Рисунок 61 — Выбор устройства для запуска
Если вы выключили эмулятор, то можно либо его запустить через AVD Manager, либо тут выбрать эмулятор и по нему щелкнуть. Но если у вас устройство медленное, и эмулятор запускается долго, то лучше его запустить заранее.
Вас могут попросить что-нибудь дополнительно установить (привыкайте к этому):
Рисунок 62 — Запрос на установку нужных библиотек
Рисунок 63 — Установка компонентов
Ждем, когда Gradle соберет проект, сформирует APK файл и загрузит его на устройство:
Рисунок 64 — Запуск приложения
Ошибки при запуске
В реальности при установке Android Studio, при запуске приложений вас может ожидать букет ошибок. Причем они постоянно разные от версии к версии Android Studio. Могут быть проблемы в совместимости JDK и Android Studio, проблемы с операционной системой, учетными записями и так далее.
Всегда лучше загуглить текст ошибки, чтобы почитать, что говорят об этом люди.
На июль 2021 года, например, при создании пустого приложения и его запуске появляется ошибка:
Рисунок 65 — Ошибка при запуске
Для исправления этой ошибки, нужно внести изменения в файл build.gradle (обратите внимание, что таких файлов два: вам нужен второй). Нужно в трех местах число 31 поменять на 30:
Рисунок 66 — Места, которые нужно поменять
А потом синхронизировать Gradle:
Рисунок 67 — Исправление ошибки
Скорее всего, когда вы читаете эту статью, то именно этой ошибки не будет.
Как запустить на реальном физическом устройстве
Вначале включим режим Для разработчиков на телефоне.
Зайдите в настройки телефона и в разделе О телефоне найдите пункт Номер сборки . Щелкните по нему 7 раз. На скриншоте ниже мне пишут: «Не нужно, вы уже разработчик», — так как я уже нажимал 7 раз на этот пункт в прошлом:
Рисунок 68 — Включение режима разработчика
Теперь в настройках телефона уровнем выше должен появиться пункт Для разработчиков :
Рисунок 69 — Режим «Для разработчиков»
В нем нужно включить пункт Отладка по USB :
Рисунок 70 — Пункт «Отладка по USB»
Теперь, если вы включите свой смартфон через кабель к компьютеру, то устройство должно увидеться в списке устройств:
Рисунок 71 — Устройство видно в списке устройств
Но оно не получится запустить приложение на нем, так как устройство имеет подпись Unknown Device . Это возникает по причине того, что на самом устройстве мы не разрешили компьютеру подключение. Разрешите:
Рисунок 72 — Разрешение подключение на телефоне
Если вы пропустили это окно, то вытащите кабель и вставьте его обратно.
После разрешения доступа устройство должно появиться полноценно:
Рисунок 73 — Устройство видно и доступно
Теперь его можно выбирать при запуске приложения на телефоне:
Рисунок 74 — Запущенное приложение
Сейчас я описал алгоритм подключения устройства в общем случае на примере Windows 10 и OnePlus 3t с Android 8.0. У вас подключение может отличаться. Лучше загуглить подключение вашего устройства к Android Studio. Пример запроса: Galaxy A6 connect Android Studio Windows 7 .
Например, на Windows 7 нужно устанавливать драйвера телефона. Где взять для некоторых марок телефонов можно найти тут: https://developer.android.com/studio/run/oem-usb.
Для Samsung телефонов на Windows 7 драйвера автоматически ставятся при установке приложений Samsung (устройства с версией Android до 4.2 включительно) и Samsung Smart Switch (устройства с версией Android выше 4.2).
Windows 10 обычно все драйвера находит автоматически.
Настройки, описанные в данном разделе, опциональны, и можно их вообще не трогать.
Переходим в настройки приложения:
Рисунок 75 — Настройки приложения
Рисунок 76 — Настройки приложения
В разделе General я ставлю возможность увеличения шрифта колесиком мыши при нажатом Ctrl , а также устанавливаю правило, что при сохранении файла все лишние пробелы справа у всех строк будут удаляться.
В статье Сложение двух чисел в Android Studio на Java (Android приложение) написано как вы можете написать простое приложение по сложению двух чисел.
Installing the Android SDK
Android Studio provides everything you need to start developing apps for Android, including the Android Studio IDE and the Android SDK tools.
If you didn’t download Android Studio, go download Android Studio now, or switch to the stand-alone SDK Tools install instructions.
Before you set up Android Studio, be sure you have installed JDK 6 or higher (the JRE alone is not sufficient)—JDK 7 is required when developing for Android 5.0 and higher. To check if you have JDK installed (and which version), open a terminal and type javac -version . If the JDK is not available or the version is lower than 6, go download JDK.
To set up Android Studio on Windows:
- Launch the .exe file you just downloaded.
- Follow the setup wizard to install Android Studio and any necessary SDK tools.
On some Windows systems, the launcher script does not find where Java is installed. If you encounter this problem, you need to set an environment variable indicating the correct location.
Select Start menu > Computer > System Properties > Advanced System Properties. Then open Advanced tab > Environment Variables and add a new system variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.7.0_21 .
The individual tools and other SDK packages are saved outside the Android Studio application directory. If you need to access the tools directly, use a terminal to navigate to the location where they are installed. For example:
To set up Android Studio on Mac OSX:
- Launch the .dmg file you just downloaded.
- Drag and drop Android Studio into the Applications folder.
- Open Android Studio and follow the setup wizard to install any necessary SDK tools.
Depending on your security settings, when you attempt to open Android Studio, you might see a warning that says the package is damaged and should be moved to the trash. If this happens, go to System Preferences > Security & Privacy and under Allow applications downloaded from, select Anywhere. Then open Android Studio again.
If you need use the Android SDK tools from a command line, you can access them at:
To set up Android Studio on Linux:
- Unpack the downloaded ZIP file into an appropriate location for your applications.
- To launch Android Studio, navigate to the android-studio/bin/ directory in a terminal and execute studio.sh .
You may want to add android-studio/bin/ to your PATH environmental variable so that you can start Android Studio from any directory.
Android Studio is now ready and loaded with the Android developer tools, but there are still a couple packages you should add to make your Android SDK complete.
The stand-alone SDK Tools package does not include a complete Android development environment. It includes only the core SDK tools, which you can access from a command line or with a plugin for your favorite IDE (if available).
If you didn’t download the SDK tools, go download the SDK now, or switch to the Android Studio install instructions.
To get started on Windows:
Your download package is an executable file that starts an installer. The installer checks your machine for required tools, such as the proper Java SE Development Kit (JDK) and installs it if necessary. The installer then saves the Android SDK Tools to a specified the location outside of the Android Studio directories.
- Double-click the executable ( .exe file) to start the install.
- Make a note of the name and location where you save the SDK on your system—you will need to refer to the SDK directory later when using the SDK tools from the command line.
- Once the installation completes, the installer starts the Android SDK Manager.
To get started on Mac OSX:
Unpack the ZIP file you’ve downloaded. By default, it’s unpacked into a directory named android-sdk-mac_x86 . Move it to an appropriate location on your machine, such as a «Development» directory in your home directory.
Make a note of the name and location of the SDK directory on your system—you will need to refer to the SDK directory later when using the SDK tools from the command line.
To get started on Linux:
Unpack the .zip file you’ve downloaded. The SDK files are download separately to a user-specified directory.
Make a note of the name and location of the SDK directory on your system—you will need to refer to the SDK directory later when using the SDK tools from the command line.
Troubleshooting Ubuntu
- If you need help installing and configuring Java on your development machine, you might find these resources helpful:
If you are running a 64-bit distribution on your development machine, you need to install additional packages first. For Ubuntu 13.10 (Saucy Salamander) and above, install the libncurses5:i386 , libstdc++6:i386 , and zlib1g:i386 packages using apt-get :
For earlier versions of Ubuntu, install the ia32-libs package using apt-get :
The Android SDK tools are now ready to begin developing apps, but there are still a couple packages you should add to make your Android SDK complete.
Install Android Development Tools
Before You Begin
This 15-minute tutorial shows you how to install Android Studio, which includes the Android SDK, and create an Android Virtual Device (AVD) on which you install an Oracle JavaScript Extension Toolkit (Oracle JET) hybrid mobile application during a later tutorial. The time to complete doesn’t include processing time as a result of your activities.
Background
The Oracle JET command-line interface invokes the Android SDK that you install with Android Studio to build an Android application package (APK) file from the source files of your hybrid mobile application. This APK file is installed on an AVD to enable you to test the hybrid mobile application.
What Do You Need?
- A computer that meets the system requirements to install Android Studio. See System requirements at https://developer.android.com/studio/
Install and Set Up Android Studio
Depending on the operating system of your computer, the Android Studio installation wizard prompts you with dialogs where you choose between standard or custom install types. Choose the options recommended by the Android Studio installation wizard as these options include the components that you require to create and install a hybrid mobile application on an AVD. They also include an Android emulator and an emulator accelerator appropriate for your computer, be that Windows, Mac, or Linux.
- Go to the Download page for Android Studio on the Android Developer’s website at https://developer.android.com/studio/ and click DOWNLOAD ANDROID STUDIO.
- Review and accept the terms and conditions in the Download Android Studio dialog that appears and click DOWNLOAD ANDROID STUDIO FOR PLATFORM where PLATFORM refers to the operating system of your machine, such as Windows, Mac, or Linux.
- Go to the Install Android Studio guide at https://developer.android.com/studio/install and follow the instructions for your operating system to install and start Android Studio.
- If you run Android Studio behind a firewall or secure network, an Android Studio First Run dialog appears which displays a button (Setup Proxy) that you click to enter the proxy server settings for your environment. This allows Android Studio to complete the download of the components for a standard install.
- In the Welcome to Android Studio dialog, select Start a new Android Studio project, and then, in the Create New Project wizard, accept the default options to progress to the final screen in the wizard and click Finish.
This enables the Android Studio toolbar with the options that you need to create an AVD. It also downloads and configures the Gradle build tool that the Android SDK invokes to build the APK file when you complete the creation of your Oracle JET hybrid mobile application.
If you run Android Studio behind a firewall or secure network, a Proxy Settings dialog appears that enables you to configure proxy settings for the Gradle build tool that Android Studio downloads and configures. Provide the proxy settings for your environment to ensure that the Gradle build tool functions correctly.
Install an Android SDK Platform Package
- In the Android Studio toolbar, click the SDK Manager icon (
) to open the Android SDK page in the Default Settings dialog.
- In the SDK Platforms tab, select Android 8.0 (Oreo) with an API Level value of 26, and click Apply.
Description of the illustration sdkmgrdialog.png
- Click OK in the confirmation dialog that appears and accept the license agreement to proceed with the installation.
- Once the installation completes, click Finish and then click OK to close the Default Settings dialog.
Create and Start an Android Virtual Device
- In the Android Studio toolbar, click the AVD Manager icon ( ) and click Create Virtual Device in the Android Virtual Device Manager dialog that opens.
- In the Phone category of the Choose a device definition page of the Virtual Device Configuration dialog, select Nexus 5X and click Next.
- In the Recommended tab of the Select a system image page, click Download for the Oreo entry with an API Level of 26.
Description of the illustration downloadoreo.png The SDK Quickfix Installation wizard opens.
- Accept the license agreement to proceed with the download of the system image for Android 8.0 with API Level 26. Once the installation completes, click Finish and then click Next in the Select a system page.
- In the Verify Configuration page, review and accept the default settings such as the AVD Name value of Nexus 5X API 26, then click Finish.
- In the Android Virtual Device Manager dialog, click the Launch this AVD in the emulator icon (
) under the Actions column for the newly-created Nexus 5X API 26 AVD.
The Android emulator starts and loads the Nexus 5X API 26 AVD. A toolbar appears to the right of the AVD that provides UI controls to interact with the AVD.
Install the Java SE Development Kit 8
- Go to the Java SE Development Kit 8 Downloads page at http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html, accept the license agreement, and download the Java SE Development Kit installation file for your platform.
- Follow the JDK installation instructions for your platform at https://docs.oracle.com/javase/8/docs/technotes/guides/install/toc.html.
Create Environment Variables
To function correctly, the Apache Cordova command-line interface that the Oracle JET command-line interface communicates with requires that you configure environment variables. These environment variables reference the installation location of the Android SDK that is installed by Android Studio and the Java SE Development Kit 8.
- For Windows.
- Open the Environment Variables dialog from the System Properties dialog by navigating Control Panel > System and Security > System > Advanced System Settings > Environment Variables.
- Click New in the Environment Variables dialog and set the values of the variables to the location of the JDK and Android SDK locations, as shown in the following image. You can obtain the Android SDK location from the Android SDK page of the Default Settings dialog that you access in Android Studio by clicking Tools > SDK Manager.
Description of the illustration envvar.png
- For Mac and Linux-type systems, the settings depend upon your default shell. For example, on a Mac system using the Bash shell, add the following lines in