编程知识 cdmana.com

[software configuration] JDK + Android studio 4.1 development Android App environment installation and configuration tutorial details


Because of the need to develop Android APP Software , So recently, we set up Android Development APP Environment , Record the detailed construction process here . The language I use is JAVA, So the construction process of the following records is also based on JAVA Building the process for the underlying environment .

One 、 Professional terms

  • JRE( Full name :Java Runtime Environment):JRE As the name suggests java Runtime environment , Contains java virtual machine ,java Base class library . It's using java The software environment needed by the program written in language , It's for you to run java Used by users of the program .
  • JDK( Full name :Java Development Kit):JDK As the name suggests java Development kit , It's programmers who use java Language writing java Development kit for the program , It's for programmers to use .JDK Contains JRE, Compilation is also included java Source compiler javac, There's a lot more java Tools for program debugging and analysis :jconsole,jvisualvm And so on , It also contains java Documentation and demo Example program .
  • Android SDK: refer to Android Exclusive software development kit . in other words , If you're going to develop Android APP You have to have Android SDK.

Two 、 Resource preparation before building

because AndroidStudio There will be downloads in the integration tool Android SDK The interface of , So we don't have to deal with Android SDK Download and install separately . We just have to take JDK and AndroidStudio Download it .
Be careful : It's better to turn off the firewall of the computer and then install it below .

2.1 JDK Download resources

According to their own needs and systems to 【JDK Official download address 】 Download the corresponding version , However, it is suggested that LTS Long term support , The download diagram is as follows :

(1) Choose good JDK edition , Click on 【JDK Download】 Button

(2) Select the version according to the development platform . My system is win10-64 position , Choose the following version :

(3)

(4) If you need a login password , You can find one directly online Oracle Just share your account and password , Or register one yourself . The following is my online account password , Close test available .

  • Oracle Account number :2696671285@qq.comOracle
  • password :Oracle123

If the download speed is slow , You can also access to my baidu disk directly ,【JDK Baidu online address 】, Extraction code :j1c3.

2.2 AndroidStudio download

(1) Click the download button

(2) Select the version according to the system , My system is win10-64 position , Choose the following version :

(3) If the download is too slow , You can also get it from my baidu disk 【AndroidStudio Baidu online address 】, Extraction code :z4j8.

3、 ... and 、 install

After downloading the resources above , Now let's install .

3.1 JDK Installation configuration

(1) Right mouse click 【jdk-11.0.9_windows-x64_bin】 choice 【 Run as administrator 】, And then it's just the next step , But be careful to save the installation directory , We'll use that later .

(2) open jdk Installation path for , Select the address bar and right-click to select 【 Copy 】. reminder :jdk The default installation path for is 【C:\Program Files\Java\jdk-11.0.9】.

(3) Right click 【 This computer 】、 choice 【 attribute 】、 choice 【 Advanced system setup 】.

(4) Click on 【 environment variable 】.

(5) Click under system variable 【 newly build 】.

(6) Variable name input 【JAVA_HOME】, Use the shortcut key in the variable value field Ctrl+V Paste jdk The path of , And then click 【 determine 】.

(7) And the (5) Step by step, click 【 newly build 】. Enter... In the variable name 【CLASSPATH】, Input in the variable value 【.;%JAVA_HOME%\lib】( It is recommended to copy directly 【】 What's in it ) And then click 【 determine 】.

(8) Find the system variables 【Path】 Variable , And then click 【 edit 】. Click on 【 newly build 】, Input 【%JAVA_HOME%\bin】 And then click 【 determine 】.

(9) Click OK to exit all windows .

(10) Press the keyboard shortcut 【win+r】, Input 【cmd】 And then click 【 determine 】, Input 【java -version】 And press... On the keyboard 【Enter】 Bond to get jdk Installation version of .

(11) Input 【java】 And then press... On the keyboard 【Enter】 key , Get the following information .

(12) Input 【javac】 And then press... On the keyboard 【Enter】 key , Get the following information .

(13) Come here JDK The installation and configuration are finished .

3.2 AndroidStudio install

(1) Open as administrator android-studio-ide-201.6858069-windows.exe Installation package , Wait for the following screen to load , Just click 【Next】

(2) choice Android Virtual Device, Click on 【next】

(3) Select the installation directory , And then click 【Next】

(4) Click on 【install】

(5) Installing , Click... After installation 【Next】

(6) Click on 【finish】 Button and start the program

(7) This step is to ask if you need to import the past Android Studio Configuration of , If you've installed Studio You can import the previous configuration , Otherwise select 【Do not import setting】 that will do , And then click 【ok】

(8) Waiting to start , After starting, it will appear , Ask if you need to set up a proxy , Here first choose not to need 【Dont't send】

(9) This step should also start with 【cancel】

(10) Click on 【Next】

(11) Just choose the first default standard configuration

(12) Select topic , Click on it 【Next】

(13) This is the time , It will list the upcoming downloads , We can see in the list Android SDK, In this step, we can take a picture and record SDK、JDK Installation directory , And then click 【Finish】

(14) Downloading resources from list , Because this step needs to visit the Internet , There may be download failures , But it doesn't matter. Follow me step by step to install it ( This step will take a while )

for example , I made the following errors when installing , Let's cut a graph and record the problem . You can click try again 【Retry】 Button , But it's useless to click to try again , We click directly 【Cancel】, Wait until later . Of course, it would be better if there were no such problems .

(15) Click on 【finish】

(16) Try to create project Try out

(17) Because there was an error when downloading the list above ,Android SDK Installation failed , So can't create project, Let's click 【Open SDK Manager】 Open the manager

(18) Because when you download the list above Android SDK No download complete , So you can see Android SDK All of them show that they are not installed , So we need to continue with the installation here Android SDK, Click on 【Edit】 choice SDK The path of ( This path is just listed in the list Android SDK route )

(19) Then continue to click 【Next】, It will continue to install , It usually works here . When the download is complete, click 【finish】

(20) Click on 【Finish】 after , You can see Android SDK The installation is successful . And then click 【ok】

Four 、 Creating Android APP engineering

(1) Create a new project

Select the theme to create , I choose an empty mobile theme here , And then click 【Next】 next step

modify Name: Name of the project 、Save location: Where the project is saved 、Language: development language 、Minimum SDk: Developing an Android version , The lower the selected version, the higher the compatibility , Because Android is backward compatible , In order to be compatible with more mobile phones , Try not to choose too high Android version . And then click 【Finish】

(2) This step is that the project is initializing , It's also important to keep the network connected , Because here also needs to download some network resources , Also from the Google Upload and download , So it's going to be a little slow , We can click in the lower right corner to see the task .

In this process, there may also be a build failure , But don't worry , There are a lot of solutions on the Internet , When it stops building , If we look for the mistakes on the Internet, we will have a way to solve them .

(3) After building , We can't run directly by clicking the Green Run button in the upper right corner , as follows

Because there is no android virtual device , There's no Android phone . If you plan to debug the program on a real machine , Connect your computer to your mobile phone , The mobile phone opens developer mode debugging, you can see your phone on the left side of the run button in the upper right corner , Otherwise, you need to create a virtual device , The steps are as follows :

(4) Create virtual devices

Click the phone button in the upper right corner , Then click create virtual device

Then choose the type of virtual device according to your own needs 、 Size , What I choose here is 5.0 " 、1920*1080 Resolution phones

And then click 【Next】 Button , Choose the Android version of the virtual phone , Click on 【Download】 Button , And then click 【Next】 Wait for download to complete

When the download is complete, click 【Finish】

Then click 【Next】 next step , Choose the device name according to your own needs 、 Mobile phone horizontal and vertical 、 Memory and other information , Click on 【Finish】

Here we're done , You can see the virtual device in the upper right corner , Then click the run button , We can see our program running on the virtual device , The build process takes a while .

Running effect

版权声明
本文为[Li Chungang]所创,转载请带上原文链接,感谢

Scroll to Top