Recently because the project needed to develop a plugin for Android studio (automating the configuration of managing Android projects), here is a description of the entire process, from development to application.
First of all, I don't know how to develop plug-ins directly on Android studio, however Android Studio is based on IntelliJ idea, so I want to develop on IntelliJ and then go around the jar package, applied on studio. Because I found https://plugins.jetbrains.com/a lot of plugins are available on Android studio and IntelliJ, and the final verification is possible.
1. Download IntelliJ idea, download and install the process will not say more.
2. Create the plugin project, File->new project, and follow the actions, Note: For the project SDK, if you do not need to create one, click New, and then point to IntelliJ Idea's installation directory is OK.
3. After the project is created, you can code it. A simple example is to create a component,firstcomponent and then create a action,firstaction that is created in such a way as:
In addition, when you create an action, you need to select groups and actions, which is the portal that launches the plugin, for example, the groups that I chose is windowmenu, and then clicking Window on Windows will show my plugin,firstaction.
4. Test, click Run->edit Configrations...->run, then you will start a IntelliJ, you can test.
5. Export the jar, click Build->make Project, then click Prepare Plugin Model ..., and a jar package will be generated in the project.
6. Finally applied in Android Studio, open Android Studio,file->settings, for example, after restarting studio, the plugin was installed successfully.
Android Studio plugin development and use