Install Android Studio and create an Android Demo

foreword

The Android development environment can be used Eclipse + ADTor can be used Android Studio, and it is commonly used now Android Studio. After all, it is Googlethe official development tool specially provided for Androidtailor-made, and the response speed is Eclipsefaster and lighter than that.

1. Download Android Studio

The download address of the 2021 version: Android Studio

Official website address: Android Studio official website

insert image description here
Create sdka directory and extract the downloaded compressed package to sdkthe directory. My directory is:E:\Android\SDK

Configure environment variables

First set an environment variable name in the system environment variable ANDROID_HOME, and write the variable value E:\Android\SDK. This is the folder where the above sdk is installed. Then PATHcreate a new one in %ANDROID_HOME%\platform-tools.
insert image description here
Add another variable to PATH:%ANDROID_HOME%\emulator

Configure avdenvironment variables. When the house creates a new avd, it will be created on the c drive by default.

Create a variable ANDROID_SDK_HOME, and the content of the variable is the address where avdthe file is to be stored. I put it directly SDKin the created folder androidAVD, address: E:\Android\SDK\androidAVD, and add it to the path %ANDROID_SDK_HOME.

insert image description here

2. Install Android Studio

After downloading, double-click the exe file to start the installation

insert image description here

Next step

insert image description here

Choose the installation address, don’t choose the C drive

insert image description here
Afterwards, I have been waiting for the installation to complete.

insert image description here

3. Install Android SDK

The Android SDK is a dependency of the development environment and needs to be installed in advance

Official website address: androiddevtools

Download address: installer_r24.4.1-windows.exe

insert image description here

Double-click installer_r24.4.1-windows.exeto install until the directory nextis selected sdk. Here I choose a non-C drive

insert image description here

After selection is completeInstall

insert image description here

After the installation is complete, start the SDK management and choose what you need to install

insert image description here
Here I add the Android 6-10 SDK, click Install, and wait for the installation to complete

insert image description here

After the installation is complete, configure the environment variables, you need to configure two directories: E:\Android\android-sdk\toolsandE:\Android\android-sdk\platform-tools

After the environment variable is configured, execute the command in the cmd window: abdor abd versionverify

insert image description here

4. Configure Android Studio

After the installation is complete, the startup Android Studiowill ask whether to introduce the default configuration, here I choose not to configure

insert image description here

Whether the statistical information is sent to Google or not

insert image description here
In the next step, if there is no Android SDKerror, the following image will be reported:

insert image description here

Select Setup ProxySet Proxy and configure it Host nameas shown in the figure below:mirrors.neusoft.edu.cn

insert image description here

For the setting type select the default standard setting:

insert image description here

Select the SDK dependency. If you do not directly choose to agree to complete, you can also download the SDK later

insert image description here

5. Create an Android project

open Android StudioclickNew Project

insert image description here

chooseBasic Actovoty

insert image description here

Fill in the basic information of the project

insert image description here

Click Finisto start creating Androidthe project, it will be initialized Gradle Build, if the report cannot be downloaded Gradleas shown below:

insert image description here
Just manually download according to the download address, put it C:\Users\用户名\.gradle\wrapper\distsunder the address, and find Studiothe directory you created. If the download fails, there will be two temporary files, as shown below:

insert image description here

Put it in this directory and restart it Studio, then wait for the compilation to complete

6. Debugging

Use USBor 无线etc. to connect to the mobile phone, here use USBthe connection, the transmission mode is传输文件

insert image description here
Turn on the phone 开发者模式, and then Android Studiostart demothe project.
insert image description here
After startup, it will be transmitted to the phone for installation

insert image description here
After choosing to continue the installation, we will see our current 安卓Appeffect

insert image description here

Guess you like

Origin blog.csdn.net/AnNanDu/article/details/126704166
Recommended