Embedded Android development 1: Android studio environment construction

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
    insert image description here
    to select the appropriate version to download.
    insert image description here

  • After the download is complete, double-click to open the installation package, as shown below:
    insert image description here
    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.
    insert image description here

  • 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.
    insert image description 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.
    insert image description here
    The following prompt allows you to choose the first startup mode, here choose custom.
    insert image description here

  • Next, the following prompt box appears, allowing you to select the path of the java development package used, and select the default:
    insert image description here
    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:
    insert image description here

  • 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
    insert image description here
    . 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.
    insert image description here

  • 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.
    insert image description here
    After both select accept, click finish
    insert image description here

  • After the download is complete, you can enter android studio and start creating a project.
    insert image description here

  • 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
    insert image description here

test

Here we first create a new test project, click new project, select an empty project, select the
insert image description here
android version (here choose 11) and save the location
insert image description here
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
insert image description here
. After the download is complete, we can see the following interface:
insert image description here
click finish.
insert image description here
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:
insert image description here
we click on the xml file to see the preview.
insert image description here
We click on the android sdk manager in the upper right corner
insert image description here
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
insert image description here
following prompt box will appear
insert image description here

Click ok. Wait patiently for the download to complete:
insert image description here

At this time, we can’t run it yet. Click the upper right corner, select device manager, and add a virtual device:
insert image description here
as follows, you can choose to create a virtual machine or use your own mobile phone. Here, choose the latter and click Physical.
insert image description here
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.
insert image description here
At this time, a mobile phone appears on the physical machine page:
insert image description here
the motor running icon in android studio, and the corresponding software will run on the mobile phone, as shown in the figure below:

insert image description here

We have completed the corresponding installation

Reference link:
Building a video tutorial
Building a text tutorial
android studio official tutorial

Guess you like

Origin blog.csdn.net/wcc243588569/article/details/129728815