foreword
Embedded engineers require a broad technology stack, and often encounter the need to be a host computer when doing projects. Therefore, it is necessary to master the basic Android development skills. Here, starting from the environment construction, we will help embedded engineers master the basic Android development step by step.
Android studio download
-
First enter the official website of android studio:
android studio official website link
to select the appropriate version to download.
-
After the download is complete, double-click to open the installation package, as shown below:
Click next, select the installation path, the default installation path is as follows:
C:\Program Files\Android\Android Studio
the next thing to do is to wait patiently for the installation to complete.
-
After the installation is complete, the pop-up prompt is as follows, here is to choose whether to import the configuration that existed on the android studio before, because we did not have android studio before, so there is no need to import the settings here.
After clicking OK, the prompt interface is as follows, saying that the android SDK plug-in list cannot be accessed, and it is asked whether to set a proxy. Choose not to, because the domestic network speed is also faster to download directly.
The following prompt allows you to choose the first startup mode, here choose custom.
-
Next, the following prompt box appears, allowing you to select the path of the java development package used, and select the default:
Here we are starting for the first time, and we need to install the necessary SDK. In the figure below, the Android Virtual Device prompt is unavailable. You can ignore it here. After we start android studio, we will install the virtual machine. Click on the picture to choose:
-
After selecting, click Next, the prompt is as follows: here we have not installed the android virtual device first, you can ignore it for now, wait until we enter the android studio, and then click OK to install it, skip it
. The following interface appears, allowing you to set the memory size of the simulated device, here you can set the default setting, and you can also adjust it in the software after setting.
-
Then click Next, and the following interface appears: the things to be downloaded are listed on the left, and the relevant copyright agreement needs to be received on the right, click Accept.
After both select accept, click finish
-
After the download is complete, you can enter android studio and start creating a project.
-
Reported a mistake, don't worry about it. This is because our CPU does not have virtualization enabled, you can enter the bios to enable virtualization. But in the actual test, you can run the virtual machine without opening it. In fact, if there is a virtual machine, we generally choose to use a physical machine for debugging, which is more practical.
Solution
test
Here we first create a new test project, click new project, select an empty project, select the
android version (here choose 11) and save the location
to create a project for the first time, since the default installation of android studio is the latest version of android, and the SDK is installed by default. It is not android11, so the sdk of android11 will be downloaded here
. After the download is complete, we can see the following interface:
click finish.
We have entered the following interface, but the directory tree on the left is not loaded, because some necessary things are still being downloaded, just wait patiently for the download to complete, as follows:
we click on the xml file to see the preview.
We click on the android sdk manager in the upper right corner
and select android 11 to install. When we are installing, the software only helps us install the latest version of the Android 13 SDK, we also need to select Android 11 and the
following prompt box will appear
Click ok. Wait patiently for the download to complete:
At this time, we can’t run it yet. Click the upper right corner, select device manager, and add a virtual device:
as follows, you can choose to create a virtual machine or use your own mobile phone. Here, choose the latter and click Physical.
To connect to the physical machine, you need to install the driver first, then open the developer options on the phone, and then open the USB debugging and USB installation software.
At this time, a mobile phone appears on the physical machine page:
the motor running icon in android studio, and the corresponding software will run on the mobile phone, as shown in the figure below:
We have completed the corresponding installation
Reference link:
Building a video tutorial
Building a text tutorial
android studio official tutorial