IDEA builds Android development environment

247 Views
No Comments

A total of 858 characters, expected to take 3 minutes to complete reading.

Configure IDEA

Quick installation of IDEA

The IDEA The official download address is here (click), here we recommend the free version now. IntelliJ IDEA Community.

There are many installation tutorials for IDEA online, and they are not introduced here.

Install Android plug-ins

Open first IDEA, just build a project, and then we click File-Settings-Plugins(I installed the Chinese-Chinese plug-in in advance here, and the English is File-Settings-Pluginsand then search Chinese You can install the Chinese plug-in!):

IDEA builds Android development environment

Search Android Plug-in and install. The installation here may be a bit slow or fail? If there is an agent, it can be found in Settings-Appearance or Behavior-System Settings-HTTP Proxy Inside the settings to speed up the subsequent download steps.

IDEA builds Android development environment

After installation, restart IDEA.

New Android Project

We click File-New-Project:

IDEA builds Android development environment

Select New Android Project, for convenience, we directly create a template Activity:

IDEA builds Android development environment

IDEA builds Android development environment

Here if you're not down Android SDK If so, it will automatically help you download and set up an open agent, otherwise.... Very slow.

After the new construction gradle It will take a while to automatically build, which may be slow:

IDEA builds Android development environment

At this time, the project cannot be run. Don't panic, just wait a little.

The main file IDEA of our project is automatically created, called MainActivity:

IDEA builds Android development environment

On the right, we are prompted to build the project. Just click Build again.

Run Project

Before running the code you write, you should first connect to the next virtual machine or your mobile phone. After all, the computer is not a mobile phone and cannot directly run your project.

We find the right side or the upper side Device Manager:

IDEA builds Android development environment

Click Add Device:

IDEA builds Android development environment

IDEA builds Android development environment

Here I'm under Android 13 of virtual machines:

IDEA builds Android development environment

IDEA builds Android development environment

After configuration, we click the run button on the upper side, IDEA will automatically help you start the virtual machine and install the program into it:

IDEA builds Android development environment

Let's just wait:

IDEA builds Android development environment

The code runs successfully!

Compile the APK file

Click on the upper left corner Build-Build APK:

IDEA builds Android development environment

We generate a self-signed APK file and don't use it on the APK Store:

IDEA builds Android development environment

Since we are generating the APK installation package for the first time, there is no certificate. Click New Certificate and follow the steps below:

IDEA builds Android development environment

IDEA builds Android development environment

Note: The password is created by yourself! Don't forget!

Select ReleaseThe next step is done!

IDEA builds Android development environment

Then wait for us to build the file in the lower right corner:

IDEA builds Android development environment

IDEA builds Android development environment

At this time in us Home Directory-app-release There will be one under the folder. apk The papers! Just throw it on your phone and install it!

END
 0
Comment(No Comments)
验证码
en_USEnglish