Building Android integrated development environment based on IntelliJ idea 13

Time:2020-8-14

[text]

[development environment]

Physical version: Win 7 ultimate (32-bit)

Java SDK version: jdk1.8.0_ 20 (32 bits)

Android SDK version: Android 4.4 (API 20)

IntelliJ idea version: IntelliJ idea 13.1

1、 The introduction of IntelliJ idea:

In 2013, the IntelliJ idea team has established a very close relationship with many leading development technologies in the industry, such as Android, spring, Scala and gradle. In this way, we will be able to stay ahead of others, provide developers with the best development tools, and let us experience the most cutting-edge development technologies. Let’s first introduce these key words:

JavaEE 8In order to fulfill our promise of providing new technology support to all Java developers “first” and “optimally”, IntelliJ idea 13 fully supports Java EE 8, the latest enterprise Java platform launched by Oracle. In the latest version of IntelliJ idea, code completion support is provided for CDI 1.1, JSF 2.2, jax-rs 2.0, batch and other new specifications. At the same time, it also provides support for new versions of application servers, such as GlassFish 4, wildly (formerly famous JBoss), Tomcat 8, etc.SpringThis time, spring development gets more help than ever in the new version of IntelliJ idea. With a new spring tool window, users can easily navigate between the context configuration and the corresponding bean class in the project. The new tool window also makes it easy for users to browse the MVC controller and its corresponding URL mapping. IntelliJ idea 13 also optimizes performance and simplifies configuration of spring projects.AndroidAt the Google I / O conference in 2013, one of the most amazing things was the preview version of Android studio, a new Android integrated development environment. Android studio is based on IntelliJ idea open source community version. The launch of this sharp tool has attracted a large number of enthusiastic Android developers, who have helped the IntelliJ platform make great progress and enrich many features. IntelliJ idea 13 is the first major release released with the help and supervision of Android developers. It has great improvements in code editor, UI designer, SQLite database access support, etc.Gradle: another important enhancement of IntelliJ idea 13 is the redefinition of gradle support, including improved project synchronization, automatic code completion for dependencies and plug-ins, fast documentation, and code generation. IntelliJ idea 13 can even automatically configure web faces and war distribution packages via gradle file. Users can browse through gradle’s support features from this introduction video.

Idea includes a free community version (open source) and a paid ultimate version, which can be found on JetBrains’ website. The ultimate version is much better for Java EE development than the community version. But for kids who do Android development, the community version is enough. Idea is developed in Java and, like eclipse, supports windows, Linux, and Mac OS X.

Eclipse needs ADT plug-ins to support Android development. The idea’s support for Android development is built-in and no other plug-ins are required. Of course, Android SDK and JDK are indispensable. It’s true that eclipse is a good open source software, but if you pursue higher development efficiency and more innovative and dazzling GUI interface, this recognized as the best java development tool is worth having.

I’ve read a few blogs about how to use IntelliJ idea to build an Android integrated development environment, but I don’t think it’s detailed,So I plan to organize a detailed picture and text tutorial, hoping to be helpful to novice (including myself)

2、 Software preparation:

Since you want to develop Android, no matter what development environment you use, Java SDK and Android SDK are indispensable. After downloading, the screenshot of my software package is as follows:

IDEA 13搭建Android集成开发环境

1. Installation of Java SDK:

Download website: http://www.oracle.com/index.html

IDEA 13搭建Android集成开发环境

IDEA 13搭建Android集成开发环境

Since my operating system is 32-bit, I download the 32-bit JDK version:

IDEA 13搭建Android集成开发环境

After the download is complete, start the installation:

IDEA 13搭建Android集成开发环境

IDEA 13搭建Android集成开发环境

Here, choose the installation path according to your preference.

After you need to configure the environment variables, you can refer to my other blog: Java configuration JDK development environment construction and environment variable configuration detailed text tutorial

2. Download Android SDK:

Now the Android SDK is bundled with ADT and eclipse, but it doesn’t matter. We can download it directly. After decompressing, we can see that the SDK has been put into a separate directory. You can use the SDK alone.

Download website: http://www.android.com/

Note: the network speed is a little slow, you know how to get in.

IDEA 13搭建Android集成开发环境

Click the text in the red box above to enter another link:

IDEA 13搭建Android集成开发环境

Click the location of the red arrow above to get the Android SDK:

IDEA 13搭建Android集成开发环境

After downloading, unzip the compressed package. The extracted file is shown in the following figure:

IDEA 13搭建Android集成开发环境

The red box above is the Android SDK we need.

3. Download and install IntelliJ idea:

Download website: http://www.jetbrains.com/idea/

IDEA 13搭建Android集成开发环境

IDEA 13搭建Android集成开发环境

In the figure above, because we are doing Android development, we choose the free community version on the right (for Java Web development, we can choose the ultimate version on the right).

After the download is complete, you can install:

IDEA 13搭建Android集成开发环境

3、 Loading SDK in idea

After running idej, the first time you run the intellia, the following dialog box will pop up

IDEA 13搭建Android集成开发环境

In the above figure, you are reminded whether there is an idea setting file of previous versions. This file is an XML file generated by the operation habits of users who have used idea before. After importing, you can directly use the previous development habits. For new users, you need to select I don’t.

IDEA 13搭建Android集成开发环境

Then we click create new project to create a new project:

IDEA 13搭建Android集成开发环境

Note:Project in IntelliJ idea is not a real project. It is actually the same concept as workspace in eclipse and solution in visual studio

Let’s look at the following table:

  eclipse     IEDA/Android Studio
work area workspace project
project project   module
quote preference module dependency

After that, a dialog box will pop up

IDEA 13搭建Android集成开发环境

In the figure above, if you want to build your Android App using gradle (this is the trend after all), you can choose the first one in the above figure: Gradle:Android Modle 。 Then the following dialog box will pop up:

IDEA 13搭建Android集成开发环境

In the figure above, we need to load the Java SDK and Android SDK that we downloaded before. Then select next:

IDEA 13搭建Android集成开发环境

Seeing the above window, I believe you are already familiar with it. It is similar to the development in ADT of Eclipse Plug-in.

Again:Application is the workspace, and module is a single project。 Then choose next:

IDEA 13搭建Android集成开发环境

As can be seen from the figure above, idea is really humanized. There are many layouts for us to choose from. Select next:

IDEA 13搭建Android集成开发环境

IDEA 13搭建Android集成开发环境

In this way, our Android program is built:

IDEA 13搭建Android集成开发环境

[scheme 2]

Or if you don’t want to build Android programs with gradle, we can choose the second one when we build new projects: Application module. As shown in the figure below:

IDEA 13搭建Android集成开发环境

Click next to open the following dialog box:

IDEA 13搭建Android集成开发环境

After loading the Android SDK and selecting next, the project is established

IDEA 13搭建Android集成开发环境

4、 To install the genymotion simulator:

1. Installation of genymotion:

Genymotion is undoubtedly the fastest and best simulator available. Download address of official website: http://www.genymotion.cn/

Register first, then download. The simplest way to install VirtualBox is to download the genymotion package containing VirtualBox, as shown in the following figure:

IDEA 13搭建Android集成开发环境

After the download is complete, start the installation. Then run the genymotion software and you will be prompted to create a virtual device. Click Yes to start creating a virtual device

IDEA 13搭建Android集成开发环境

Use the previously registered account to connect:

IDEA 13搭建Android集成开发环境

Then select one of the versions of the emulator:

IDEA 13搭建Android集成开发环境

IDEA 13搭建Android集成开发环境

IDEA 13搭建Android集成开发环境

IDEA 13搭建Android集成开发环境

In this way, our simulator is built. Next, we will associate the simulator with IntelliJ idea.

2. Associate the simulator genymotion with IntelliJ idea:

First, download the plug-in from the official website of genymotion

IDEA 13搭建Android集成开发环境

Then, open idea, select the menu bar “file — settings”, the following interface appears, and select plugins:

IDEA 13搭建Android集成开发环境

In the above figure, select “install plugin from disk” to load the plug-in locally. The following interface will pop up:

IDEA 13搭建Android集成开发环境

In the figure above, select the plug-in we downloaded before and load it. In this way, we can see another genymotion plug-in in in the plug-in list

IDEA 13搭建Android集成开发环境

Restart the plug-in and let the new software take effect. After restarting the software idea, select “view — Toolbar” in the menu bar to display the toolbar. You can see that the toolbar has more icons of genymotion Device Manager:

IDEA 13搭建Android集成开发环境

Click this icon to open the following interface:

IDEA 13搭建Android集成开发环境

In the figure above, load the genymotion folder that we installed before. Then click this icon to open the following interface:

IDEA 13搭建Android集成开发环境

In the above figure, we can see the simulator we have built before. Click “start” to start the simulator:

IDEA 13搭建Android集成开发环境

be accomplished.

Of course, if you want to run the program on the emulator, make sure that the Android SDK is loaded on the emulator:

IDEA 13搭建Android集成开发环境

Otherwise, an error will be reported as follows:

 IDEA 13搭建Android集成开发环境

5、 Simple setting of idea:

Subject modification:

Maybe you think the interface of the software is not very good-looking, we can change the theme. Select “file — settings — appearance — theme” in the menu bar, and select darcula as the theme:

IDEA 13搭建Android集成开发环境

Code font modification:

Select “file — settings — editor — colors & fonts — font” in the menu bar:

IDEA 13搭建Android集成开发环境

The default scheme in the above figure cannot be changed. Click Save as to create a new name (such as myfont)

IDEA 13搭建Android集成开发环境

In the picture above, we can choose the font we want.

You can also change the font of the console:

IDEA 13搭建Android集成开发环境

More tips on using idea will be discussed in the future.