I haven't developed Android for a long time, and the latest computer I'm using doesn't have Android studio anymore. To this end, this blog post records the recent process of rebuilding Android development. This blog post is only for my study record (** don’t read it)
Table of contents
Install Android Studio and JDK
Get started with Android Studio
The previous blog also recorded the configuration of Android
Install Android Studio and JDK
JDK
Install the JDK website: Software Download | Oracle
At present, the latest ones are 20 and 17. I feel that there are relatively few information on the Internet for 20, so it is better to install 17~
download exe file
In this way, the installation is complete, enter the C drive to see
Click "Close", and then configure the environment variables. Right-click "This PC" and select Properties, then a pop-up window will appear, click "Advanced System Settings". (Note that win11 is slightly different from the previous version. Windows 11 configures Java environment variables_s1doer's blog-CSDN blog )
Select the environment variable, select the "New" option under "System Variables", the variable name is JAVA_HOME, and the variable value is the installation path of JDK
After the input is complete, click Confirm, the first configuration is completed, and then proceed to the second step
Select the "New" option under "System Variables". The variable name is "CLASSPATH. The variable value is: .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar (note that there is a point in front), configure After that, the following picture can be copied and pasted here.
Then click OK to save the variable and go to the third step.
Find the variable path in the environment variable and double-click to open it. Then you can see that there are already a lot of content in the path, we create a new one at the end:
Add %Java_Home%\bin;%Java_Home%\jre\bin; at the beginning of the variable value
Check whether the Java environment is configured successfully
Press the shortcut key Win+R, enter cmd, and then enter java
type javac
Enter java -version
Sincerely, the JDK configuration is complete!
Android Studiio
Go directly to the official website to download: https://developer.android.com/studio
Android Studio must install
Android Virtual Device virtual machine device, no real machine can be installed
It is recommended to install
default is fine
does not import configuration,
Android Studio will put your SDK download on the C drive by default. Although my computer only has one drive, I still choose Custom , and then click Next .
used to black
default
Install the Android virtual machine driver and click Next .
Click Accept to start the download
Get started with Android Studio
After downloading, it is installed, and then you can start using it.
Note that the template is no longer java but the recommended Kotlin at this time, so you can choose the java language without using the default template~
Run the virtual device first, as shown in the figure below
Mobile phone debugging:
First, in the settings, -- about the phone --- click the version number continuously, and the developer mode will appear, and the developer mode will be turned on after completion
Then, phone settings--system and update--developer options--turn on the developer mode. First turn on "Allow ADB debugging in "Charge Only" mode" and then turn on usb debugging.
Then it will appear as shown in the figure
can