Smart terminal application development-Andriod Studio installation

task

Install Android studio on your laptop; because the latest version of Android studio is installed, the online tutorial versions are all relatively old. So they are groping slowly. Follow-up errors and solutions during use will be detailed in a later article. Hope to be considerate!

One, Android studio installation

1. JDK installation and environment variable configuration

JDK installation

Regarding the download and installation of the JDK, you need to download it on Baidu. I will upload the JDK to the network disk at the end, and you can download it yourself if you need it. Because the computer files were mixed and the system was reinstalled before, here is the configuration of the JDK again.

Choose the appropriate version of JDK to install according to your own computer;
Insert picture description here
double-click to enter the installation interface, and click Next;
Insert picture description here

Change the installation path by yourself;
Insert picture description here
successful installation, click close; Insert picture description here
environment variable configuration
Solution 1:
Right-click "My Computer" and select "Properties";
Insert picture description here
search for "Advanced System Settings";
Insert picture description here
Solution 2:
Windows terminal, cmd and enter "Control Panel" ;
Insert picture description here
Find "Advanced System Settings" in the "Control Panel" interface;
Insert picture description here
enter the system properties, select environment variables; (no need to click OK)
Insert picture description here
create a new environment variable; ( 系统变量)
Insert picture description here

Variable name: JAVA_HOME
Variable value: The installation path where the JDK is located
My path: C:\Program Files\Java\jdk-15.0.1

Insert picture description here
As follows:
Insert picture description here
Click New;

Variable name: CLASSPATH;
Variable value: .;%JAVA_HOME%libdt.jar;%JAVA_HOME%lib ools.jar

Insert picture description here
As follows:
Insert picture description here
Find Path in the system variables and click edit;

Variable value: %JAVA_HOME%in;%JAVA_HOME%jrein;

Insert picture description here
Finally, just keep clicking OK.
Check whether the JDK is installed successfully
. Enter cmd with the shortcut key "win+R" and enter the command: java -version;
Insert picture description here
input command: java;
Insert picture description here
input command: javac;
Insert picture description here
At this point, the environment variable configuration of the JDK is complete.

2. Download Android studio

Many online tutorials come with installation packages, but the data is relatively large, so you can choose to download them from the official website.

Android studio official website .

Click the link to enter the official website interface;
Insert picture description here
you can directly click download, for most users, you can also slide to the bottom of the interface to select the appropriate version to download and install;
Insert picture description here
agree to the license regulations, then start the download;
Insert picture description here
select the installation path to download;
Insert picture description here
wait for the download ; The
Insert picture description here
download is complete;
Insert picture description here
check the location of the file;
Insert picture description here

3. Install Android studio

Double-click the downloaded installation package to start the installation;
Insert picture description here
click next to start the installation;
Insert picture description here
continue to click next;
Insert picture description here
select the installation path;
Insert picture description here
click install;
Insert picture description here
wait for the installation;
Insert picture description here
click finish and
Insert picture description here
click the second one; then OK;
Insert picture description here
depending on personal wishes. I choose not to send;
Insert picture description here
prompt that there is no SDK, click cancel;
Insert picture description here
enter another interface, click next;
Insert picture description here
select custom, click next;
Insert picture description here
then click next, the background color indicated by the two circles on the head is black;
Insert picture description here
click next;
Insert picture description here
Click Finish;
Insert picture description here
waiting for the download, it's a bit slow, don't worry;
Insert picture description here
if a pop-up window appears in the middle, click retry; OK, click finish; the
Insert picture description here
installation is complete;
Insert picture description here

4. SDK configuration of Android studio

Enter the icon interface, click configure to configure;
Insert picture description here
select SDK manager;
Insert picture description here
enter the interface as shown, select your own Android version to download;
Insert picture description here
Android version;
Insert picture description here
agree, next;
Insert picture description here
wait for install; when
Insert picture description here
finished, click finish. Select the default Project Structure;
Insert picture description here
change to the installation path of the JDK;
Insert picture description here
Insert picture description here
create a shortcut;

Find the file path, you will find a shortcut, just copy it to the desktop.

Insert picture description here

Two, Android studio demo

1. Create a new project

Double-click the desktop shortcut to enter the Android studio interface and choose to create a new Android studio project;
Insert picture description here
after clicking, enter the following interface;
Insert picture description here
select the layout and click next;
Insert picture description here
enter the device name, select the environment parameters for the application to run, and specify the minimum SDK here . In this tutorial, we choose API 21: Android 5.0 (Lollipop);

Insert picture description here
Insert picture description here
To display the interface, click Finish;
Insert picture description here
enter the graphical interface;
Insert picture description here

2. Create an Android virtual device

Click the icon to start the Android manager;
Insert picture description here
after clicking the virtual device icon, the default virtual device that is already in the SDK will be displayed. Click the "Create new Virtual device" button to create a virtual device;
Insert picture description here
select the emulator model;
Insert picture description here
follow the prompts to select the appropriate version install;
Insert picture description here
download according to the prompts, and wait for the download. It will take a long time and wait patiently;
Insert picture description here
after the progress bar is completed, the next two interfaces "Finish"——"next"; enter the next interface;
set the simulator information, (if you don't know how to set it), click the default; the
Insert picture description here
creation is successful, the following button
Insert picture description here
appears ; the following interface indicates success; the
Insert picture description here
window cannot be closed, click The simulator is similar to the shutdown button of a mobile phone.

3. Create a simulated device error handling

Error reporting problem:
Insert picture description here
Solution 1
Click on the Terminal that comes with Android Studio;
Insert picture description here
enter the command:

netstat -ano | findstr "5037

Insert picture description here
The PID of the process occupying the port in the above figure is 15696, kill the process of the port
Enter the command:

taskkill /pid 15696 /f

Successfully blocked the process;
Insert picture description here
Solution 2
In order to no longer have the problem after restarting the computer, we can create a new environment variable and modify the port used by adb;
enter the setting interface;
Insert picture description here
enter "environment" in the input box, and click to edit the system environment variable ; The
Insert picture description here
following is the operation of changing environment variables, so I won't go into details here.
Click the New button under System Variables;
Insert picture description here
enter the following values ​​in the pop-up window;

输入变量名为:ANDROID_ADB_SERVER_PORT
输入变量值为:10000——60000(为了不与其他的端口冲突取区间任意值)

Insert picture description here
Just click OK.

Three, summary and reference materials

1. Summary

Android Studio is an Android integrated development tool based on IntelliJ IDEA. Similar to EclipseADT, Android Studio provides integrated Android development tools for development and debugging. On the basis of IDEA, Android Studio provides:
Gradle-based construction supports
Android exclusive refactoring and quick fixes
Prompt tools to capture performance, usability, version compatibility and other issues
Support ProGuard and application signature
template-based wizards to generate commonly used Android Application design and components A
powerful layout editor that allows you to drag and drop UI controls and preview the effects

2. Reference materials

Android Studio installation tutorial .
Android Studio detailed installation process and configuration, themes .
Programming software: Android Studio software installation tutorial .
Each directory and file of the project in
Android Studio . Android Studio download and installation .
Android Studio installation .

Guess you like

Origin blog.csdn.net/QWERTYzxw/article/details/114441856