- Плагины
- Rainbow Brackets
- Nyan Progress Bar
- RoboPOJOGenerator
- ADB Idea
- ADB WIFI
- Android Studio Plugin Development
- Introduction
- Configuring IntelliJ Platform Projects for Android Studio Plugin Development
- Matching Versions of the IntelliJ Platform with the Android Studio Version
- Configuring the Plugin build.gradle File
- Configuring the Plugin plugin.xml File
- Android Specific Extension Points
- Additional Articles and Resources
- Open Source Plugins for Android Studio
- How to install plugins in Android Studio
- How to Install and Uninstall Plugins in Android Studio?
- Step by Step Process to Install and Uninstall Plugins in Android Studio
- Топ-17 плагинов для Android Studio
- 1. String Manipulation
- 2. Codota
- 3. Индикатор использования CPU
- 4. Rainbow Brackets
- 5. Project Lombok
- 6. Android Drawable Importer
- 7. Vector Drawable Thumbnails
- 8. Android Drawable Preview Plugin
- 9. Name That Color
- 10. bundletool
- 11. Butterknife Zelezny
- 12. Android Input
- 13. ADB Idea
- 14. adb-enhanced
- 15. ADB WIFI
- 16. Here there be dragons
- 17. Power Mode 2
- И напоследок
Плагины
Установленные плагины находятся в меню File | Settings. | Plugins. Кнопка Browse repositories. позволяет найти плагин в репозитории. Кнопка Install plugin from disk. позволяет установить плагин с диска, если вы его скачали самостоятельно.
Rainbow Brackets
«Радужные скобки» позволяют пометить каждую пару скобок своим индивидуальным цветом. Это помогает визуально видеть, где находится область кода.
Nyan Progress Bar
Заменяет все индикаторы прогресса в студии на няшного котика. Если вы серьёзный программист, то просто обязаны установить плагин Nyan Progress Bar. Совместимо с другими средами разработки на основе IntelliJ IDEA: PhpStorm, WebStorm, PyCharm, RubyMine, AppCode, CLion, Gogland, DataGrip, Rider, MPS.
Появляется везде. Например, при загрузке проекта.
Во время работы при синхронизации чего-либо.
RoboPOJOGenerator
Удобный генератор готовых Java и Kotlin POJO классов из JSON: GSON, FastJSON, AutoValue (GSON), Logan Square, Jackson.
ADB Idea
Плагин для Android Studio/Intellij IDEA для быстрых операций над приложением:
- Uninstall App — удалить приложение из устройства
- Kill App — убить приложение (удалить из памяти)
- Start App — запустить приложение
- Restart App — перезапустить приложение
- Clear App Data — очистить данные
- Clear App Data and Restart — очистить данные и перезапустить
После установки эти команды можно найти через Tools | Android | ADB IDEA.
Также можно вызвать окно поиска действий через комбинацию клавиш Ctrl+Shift+A и с помощью символов ADB быстро найти конкретную команду.
Плагин удобен для проверки работоспособности приложения в разных состояниях. Например, вы ранее создали базу данных и решили посмотреть, как поведёт себя приложение при пустой базе. С помощью плагина вы быстро можете очистить данные и посмотреть на результат.
ADB WIFI
Плагин для проверки приложения на устройстве через Wi-Fi. Полезно, если ваш кот перегрыз USB-провод и вы не можете подлючить телефон к компьютеру для отладки.
Источник
Android Studio Plugin Development
Introduction
Android Studio plugins extend or add functionality to the Android Studio IDE. Plugins can be written in Kotlin or Java, or a mix of both, and are created using IntelliJ IDEA and the IntelliJ Platform. It’s also helpful to be familiar with Java Swing. Once completed, plugins can be packaged and distributed at JetBrains Plugin Repository.
Android Studio plugins are not Android modules or apps to run in the Android operating system, such as smartphones or tablets.
Configuring IntelliJ Platform Projects for Android Studio Plugin Development
To create a new Android Studio plugin project, follow the tutorial on the Getting Started with Gradle page. The tutorial produces a skeleton project suitable to use as a starting point for an Android Studio plugin. On the New Project Configuration Screen of the New Project Wizard tutorial, choose Gradle from the product category pane as described in the tutorial, not Android. Some minor modifications to the skeleton project are needed, as discussed below.
Matching Versions of the IntelliJ Platform with the Android Studio Version
For API compatibility, it is essential to match the version of the IntelliJ Platform APIs used for plugin development with the target version of Android Studio. The version number of Android Studio contains the version of the underlying IntelliJ Platform APIs that were used to build it.
To find the version of the IntelliJ Platform used to build Android Studio, use the Android Studio About dialog screen. An example is shown below. In this case, the (BRANCH.BUILD.FIX) version of the IntelliJ Platform is 191.8026.42 , which corresponds to the IntelliJ IDEA version 2019.1.4. The build.gradle configuration steps section below explains how to set the IntelliJ Platform version to match the target version of Android Studio.
Configuring the Plugin build.gradle File
The use-case of developing for a non-IntelliJ IDEA IDE is reviewed in the Plugins Targeting Alternate IntelliJ Platform-Based IDEs section of the Configuring Gradle for IntelliJ Platform Plugins page. The particular example in that section discusses configuring a plugin project for PhpStorm, so the details for an Android Studio plugin project are reviewed here.
Here are the steps to configure the build.gradle file for developing a plugin to target Android Studio:
The Gradle plugin attributes describing the configuration of the IntelliJ Platform used to build the plugin project must be explicitly set. Continuing with the example above, set the intellij.version value to 191.8026.42 . Alternatively, specify intellij.localPath to refer to a local installation of Android Studio.
Android Studio plugin projects that use APIs from the android plugin must declare a dependency on that plugin. Declare the dependency in build.gradle using the Gradle plugin intellij.plugins attribute, which in this case lists the directory name of the plugin.
The best practice is to use the target version of Android Studio as the IDE Development Instance. Set the Development Instance to the (user-specific) absolute path to the target Android Studio application.
The snippet below is an example of configuring the Setup and Running DSLs in a build.gradle specific to developing a plugin targeted at Android Studio.
Configuring the Plugin plugin.xml File
When using APIs from the android plugin, declare a dependency:
As discussed in the Plugin Dependencies section of this guide, a plugin’s dependency on Modules Specific to Functionality must be declared in plugin.xml . When using Android Studio-specific features (APIs), a dependency on com.intellij.modules.androidstudio must be declared as shown in the code snippet below. Otherwise, if only general IntelliJ Platform features (APIs) are used, then a dependency on com.intellij.modules.platform must be declared as discussed in Plugin Compatibility with IntelliJ Platform Products.
Android Specific Extension Points
See Android Plugin section in Extension Point List.
Additional Articles and Resources
Open Source Plugins for Android Studio
When learning new development configurations, it is helpful to have some representative projects for reference:
ADB Idea plugin for Android Studio and Intellij IDEA that speeds up Android development.
Источник
How to install plugins in Android Studio
Oct 11, 2017 · 3 min read
Some times little but important things like how to install a plugin can just skip ones memory or better still beginners might be trying out a tutorial and wondering, how can a plugin be installed on Android Studio. This article will address that concisely. Follow along as we walk through.
For someone who does not know what a plugin is, he r e is a simple definition. A plugin is a feature specific component added to a program such as an IDE (in this case Android Studio). A plugin is usually designed to augment for some specific features that a program did not originally come with. This helps in increasing the developers efficiency. Examples of plugins include the kotlin plugin for Android Studio 2.3.3, the android parcelable code generator plugin, Android Material Design Icon generator, Butterknife Zelezny, and so many others.
Now let’s go into the business of the day. It is assumed you have Android Studio (for this article I am using version 2.3.3) installed properly on your machine and internet connection. Follow the steps outlined below.
- Run Android Studio. You might need to create a sample demo app just to fully allow the plugin install. You can also open an existing project.
- Click on the File menu or use Alt + F to access the file menu. And then click on Settings as shown below.
The Settings Window can also be accessed directly using Ctrl + Alt + S .
3. On the Settings window, Click on the Plugins tab on the side menu. There are three buttons below the list of installed plugins displayed. The first is meant for installing JetBrains plugins, the second is for installing plugins in repositories other than that of JetBrains while the last is to install a plugin that has already been downloaded to your local disk. Click one of the buttons that fall in the most suitable category.
4. On Browse plugins window that is opened, type in the name of the plugin to be installed on the search text field and click the green Install button on the right hand side. After the installation is complete, click the Close button just at the bottom right hand corner.
5. On the Settings window you can search for the plugin to confirm the installation and click the Ok button.
After these brief steps, you have your plugin installed and functional on Android Studio.
Источник
How to Install and Uninstall Plugins in Android Studio?
Android Studio provides a platform where one can build apps for Android phones, tablets, Android Wear, Android TV, and Android Auto. Android Studio is the official IDE for Android application development, and it is based on the IntelliJ IDEA. One can develop Android Applications using Kotlin or Java as the Backend Language and it provides XML for developing Frontend Screens.
In computing, a plug-in is a software component that adds a particular characteristic to an existing computer program. When a program supports plug-ins, it enables customization. Plugins are a great way to increase productivity and overall programming experience.
Some tasks are boring and not fun to do, by using plugins in the android studio you can get more done in less time. Below is the list of some very useful plugins in the table that are highly recommendable for an android developer.
Key Promoter X | Key Promoter X helps to get the necessary shortcuts while working on android projects. When the developers use the mouse on a button inside the IDE, the Key Promoter X shows the keyboard shortcut that you should have used instead. |
Json To Kotlin Class | Json to Kotlin Class is a plugin to generate Kotlin data class from JSON string, in another word, a plugin that converts JSON string to Kotlin data class. With this, you can generate a Kotlin data class from the JSON string programmatically. |
Rainbow Brackets | Rainbow Brackets adds rainbow brackets and rainbows parentheses to the code. Color coding the brackets makes it simpler to obtain paired brackets so that the developers don’t get lost in a sea of identical brackets. This is a very helpful tool and saves the confusion of selecting which bracket needs to be closed. |
CodeGlance | Codeglance plugin illustrates a zoomed-out overview or minimap similar to the one found in Sublime into the editor pane. The minimap enables fast scrolling letting you jump straight to sections of code. |
ADB Idea | ADB Idea is a plugin for Android Studio and Intellij IDEA that speeds up the regular android development. It allows shortcuts for different emulator functionalities that are usually very time consuming, like resetting our app data, uninstalling our app, or starting the debugger. |
Step by Step Process to Install and Uninstall Plugins in Android Studio
Step 1: Open the Android Studio and go to File > Settings as shown in the below image.
Step 2: After hitting on the Settings button a pop-up screen will arise like the following. Here select Plugins in the left panel. Make sure you are on the Marketplace tab. Then search for the required plugins as per the developer’s requirements. After selecting the required plugins then click on the green colors Install button at the right and at last click on the OK button below.
Note: There might be a need to Restart the Android Studio. For example, you may refer to How to Install Genymotion Plugin to Android Studio.
After these brief steps, you have your plugin installed and functional on Android Studio. Similarly if one wants to disable or uninstall the installed plugins then follow the last step.
Step 3: To disable or uninstall a plugin this time go to the Installed tab. And here you can find the all installed plugins in your android studio. Just click on that plugin which one you want to disable or uninstall. Then select the Disable or Uninstall button at the right as shown in the below image. At last click on the OK button and you are done.
Note: There might be a need to Restart the Android Studio.
Источник
Топ-17 плагинов для Android Studio
Существуют сотни плагинов для Android Studio, и их число растёт с каждым днём. Это в основном происходит по двум причинам. Во-первых, Android Studio — это официальная интегрированная среда разработки для создания Android-приложений. Во-вторых — Intellij IDEA, платформа, на которой основана Android Studio, позволяет разрабатывать и легко устанавливать полезные плагины, совместимые с обеими IDE. Какие плагины устанавливаете вы?
Конечно, вы можете программировать в «голой» Android Studio, просто установив необходимые библиотеки и не добавив ни одного плагина. Но зачем? Плагины для Android Studio могут сделать вашу работу более эффективной и увлекательной. Сейчас мы расскажем вам про топ плагинов Android Studio, которые смогут утроить (как минимум) вашу производительность.
В список лучших плагинов для Android Studio мы включили некоторые базовые инструменты, проверенные временем, а также ряд малоизвестных жемчужин, рекомендованных опытными разработчиками Android-приложений. Итак, вот наши любимые плагины Android Studio:
1. String Manipulation
Как следует из названия, этот плагин поможет сэкономить часы утомительной ручной работы со строками. Он позволяет изменять стиль текста (camelCase, kebab-lowercase, KEBAB-UPPERCASE, snake_case, SCREAMING_SNAKE_CASE, dot.case, нижний регистр, Заглавные Буквы, PascalCase), кодировать / декодировать, увеличивать / уменьшать, сортировать, фильтровать и выравнивать.
2. Codota
Вы только посмотрите, на что способен следующий плагин. Плагин Codota использует машинное обучение для автодополнения вашего кода. Плагин учится на примерах кода из миллионов Java-программ вместе с вашим собственным уникальным контекстом. Используемый как начинающими, так и опытными Java-разработчиками, Codota ускоряет разработку и помогает устранить те раздражающие ошибки, которые появляются в вашем коде.
В дополнение к плагину, Codota также предлагает обширную библиотеку часто используемых фрагментов Java-кода для копирования и вставки в нужное место.
3. Индикатор использования CPU
Этот простой плагин намного полезнее, чем можно подумать на первый взгляд. Поскольку ваш код и приложение становятся более сложными для компиляции и запуска, это будет сказываться на вашем процессоре. Одна из наиболее полезных функций индикатора использования процессора — это возможность генерировать дамп потока, чтобы показать, что засоряет процессор в фоновом потоке.
4. Rainbow Brackets
Скобки всегда были источником головной боли для программистов. Сколько часов было потрачено на поиск этой недостающей скобки? Хватит это терпеть!
Вместо того, чтобы сидеть и пытаться понять, какую скобку вы уже закрыли, а какую ещё нет, разукрасьте скобки с помощью плагина Rainbow Brackets.
Он поддерживает Java, Scala, Clojure, Kotlin, Python, Haskell, Agda, Rust, JavaScript, TypeScript, Erlang, Go, Groovy, Ruby, Elixir, ObjectiveC, PHP, HTML, XML, SQL, Apex, C #, Dart и другие языки.
5. Project Lombok
Сложный Java-код для Android-приложений часто может содержать много шаблонного кода (конструкторы, геттеры, сеттеры). Это может быть утомительно и трудно с точки зрения читабельности и поддержки кода. Project Lombok — это Java-библиотека, которая подключается к вашей IDE и генерирует этот шаблонный код за вас, сохраняя ваш код лаконичным и читабельным. Разница кода до и после может быть довольно ошеломляющей.
Стоит отметить, что Lombok, будучи библиотекой времени компиляции, не сделает ваше приложение более тяжеловесным. Кроме того, разработчики плагина на своём сайте предлагают много полезных ресурсов для пользователей и разработчиков плагинов.
6. Android Drawable Importer
Если вы собираетесь работать с drawable при разработке Android-приложения, то это именно тот плагин, о существовании которого вам следует знать.
Чтобы адаптировать ресурсы ко всем размерам и разрешениям экрана Android-устройств, в каждом Android-проекте есть папка drawable. Если вы были благословлены дизайнером из Рая, который предоставляет ресурсы, уже находящиеся в нужных папках с правильными именами, мы искренне завидуем вам. Но скорее всего, вам вряд ли так повезло, и вы сами переименовываете и перемещаете PNG-файлы в нужные папки.
Android Drawable Importer — это плагин, который сэкономит вам массу времени. Он позволяет импортировать отдельные ресурсы для регулирования под необходимые размеры и разрешения, целые zip-файлы для автоматического размещения в необходимые папки.
7. Vector Drawable Thumbnails
Для предварительного просмотра векторного XML-файла нужно запускать приложение. Vector Drawable Thumbnails поможет вам избавиться от этого и отобразит векторные рисунки по одному щелчку мыши.
8. Android Drawable Preview Plugin
Когда в вашем проекте много drawable-компонентов, ориентироваться в них бывает очень сложно. Было бы неплохо, если бы в IDE был быстрый предварительный просмотр изображений, да? С Android Drawable Preview Plugin это возможно.
Этот плагин для Android Studio заменяет иконки по умолчанию в дереве файлов проекта предварительными просмотрами элементов. Но не забывайте использовать адекватные имена для drawable, это всё равно важно.
9. Name That Color
Позвольте мне начать с разрушения мифа. Не все женщины могут отличить бирюзу от цвета морской волны или цвет баклажана от цвета сливы. И для этого не обязательно быть дальтоником.
Наличие и популярность этого плагина говорит о том, что большинство разработчиков также не имеют этого волшебного навыка распознавания цветов.
Плагин Name That Color назовёт цвет, который у вас есть в буфере обмена, прямо в файле ресурсов в Android Studio, и даст название наиболее близкого соответствующего цвета. Эпоха «lighter_light_pink» в ваших xml-файлах подходит к концу.
10. bundletool
bundletool — это базовый инструмент, который Gradle, Android Studio и Google Play используют для создания Android App Bundle или преобразования app bundle в различные APK, развёртываемые на устройствах. Этот инструмент от Google необходим для более эффективной работы с APK-пакетами.
11. Butterknife Zelezny
Android ButterKnife — это библиотека для внедрения зависимостей. Как правило, это улучшает читабельность кода, позволяя сосредоточиться на логике, а не смешивать в кучу код для поиска View-компонентов или добавления слушателей.
Android ButterKnife Zelezny — плагин для Android Studio для создания инъекций ButterKnife из выбранных XML-макетов в Activity, фрагментах или адаптерах. Большинство руководств по ButterKnife, которые вы найдёте, будут рекомендовать вам установить Zelezny.
12. Android Input
Android Input — это довольно простой, но полезный плагин для Android Studio, который позволяет легко вводить текст прямо на ваше Android-устройство или эмулятор. Он запоминает последнее использованное устройство и последний введённый текст.
13. ADB Idea
Этот плагин как для Intellij IDEA, так и для Android Studio добавляет ряд полезных сочетаний клавиш для различных команд ADB-инструментов прямо в вашей IDE. Хотя это кажется излишним дополнением, разработчики говорят, что ADB Idea действительно может ускорить разработку и отладку Android-приложений.
14. adb-enhanced
Называя себя «швейцарским ножом для тестирования и разработки под Android», adb-extended — интерфейс командной строки для запуска различных сценариев. Это позволяет вам протестировать многие потенциально ошибочные поведения приложений, такие как поворот экрана, режим экономии заряда аккумулятора, режим сохранения данных, режим ожидания и предоставление или отзыв разрешений.
15. ADB WIFI
Этот плагин упрощает подключение устройства к ADB через WiFi для отладки. Как и многие другие небольшие, но удобные плагины, этот — это просто обёртка для серии команд, которые вы можете выполнить в командной строке. Но почему бы не сделать этот процесс комфортнее?
16. Here there be dragons
Here there be dragons — это плагин Intellij и Android Studio, который позволяет аннотировать ваши «нечистые» Java-методы аннотацией @SideEffect. При вызове такого метода плагин отображает маленький значок дракона.
Да и к тому же этот плагин слишком симпатичный, чтобы не включать его в наш список. Это же драконы!
17. Power Mode 2
Вы знаете, ваш код просто эпичен. Когда вы ночи напролёт кодите, а в вашей крови высокое содержание кофеина, то можно почувствовать, как ваши пальцы изрыгают огонь и сотрясают мир. Вы — Бог. И вы заслуживаете того, чтобы программировать, как Бог.
И напоследок
Прежде чем приступить к установке всех плагинов из списка, вы должны помнить, что большое количество плагинов обычно замедляет работу IDE. Подумайте о своих привычках во время написания кода и посмотрите, какие плагины будут экономить ваше время, не добавляя лишнего веса в Android Studio.
Источник