foreword
The Android development environment can be used Eclipse + ADT
or can be used Android Studio
, and it is commonly used now Android Studio
. After all, it is Google
the official development tool specially provided for Android
tailor-made, and the response speed is Eclipse
faster and lighter than that.
1. Download Android Studio
The download address of the 2021 version: Android Studio
Official website address: Android Studio official website
Create sdk
a directory and extract the downloaded compressed package to sdk
the 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 PATH
create a new one in %ANDROID_HOME%\platform-tools
.
Add another variable to PATH:%ANDROID_HOME%\emulator
Configure avd
environment 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 avd
the file is to be stored. I put it directly SDK
in the created folder androidAVD
, address: E:\Android\SDK\androidAVD
, and add it to the path %ANDROID_SDK_HOME
.
2. Install Android Studio
After downloading, double-click the exe file to start the installation
Next step
Choose the installation address, don’t choose the C drive
Afterwards, I have been waiting for the installation to complete.
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
Double-click installer_r24.4.1-windows.exe
to install until the directory next
is selected sdk
. Here I choose a non-C drive
After selection is completeInstall
After the installation is complete, start the SDK management and choose what you need to install
Here I add the Android 6-10 SDK, click Install, and wait for the installation to complete
After the installation is complete, configure the environment variables, you need to configure two directories: E:\Android\android-sdk\tools
andE:\Android\android-sdk\platform-tools
After the environment variable is configured, execute the command in the cmd window: abd
or abd version
verify
4. Configure Android Studio
After the installation is complete, the startup Android Studio
will ask whether to introduce the default configuration, here I choose not to configure
Whether the statistical information is sent to Google or not
In the next step, if there is no Android SDK
error, the following image will be reported:
Select Setup Proxy
Set Proxy and configure it Host name
as shown in the figure below:mirrors.neusoft.edu.cn
For the setting type select the default standard setting:
Select the SDK dependency. If you do not directly choose to agree to complete, you can also download the SDK later
5. Create an Android project
open Android Studio
clickNew Project
chooseBasic Actovoty
Fill in the basic information of the project
Click Finis
to start creating Android
the project, it will be initialized Gradle Build
, if the report cannot be downloaded Gradle
as shown below:
Just manually download according to the download address, put it C:\Users\用户名\.gradle\wrapper\dists
under the address, and find Studio
the directory you created. If the download fails, there will be two temporary files, as shown below:
Put it in this directory and restart it Studio
, then wait for the compilation to complete
6. Debugging
Use USB
or 无线
etc. to connect to the mobile phone, here use USB
the connection, the transmission mode is传输文件
Turn on the phone 开发者模式
, and then Android Studio
start demo
the project.
After startup, it will be transmitted to the phone for installation
After choosing to continue the installation, we will see our current 安卓App
effect