This article has participated in the “Digitalstar Project” and won a creative gift package to challenge the creative incentive money.

preface

Create a HelloWorld project, and once it’s up and running, analyze what you need to know to get started with hongmeng development. If you want to study directly through the official website, I will post the official website address for you, or you can first see if you are interested in hongmeng Development according to the content of my article and then go to the official website to study seriously!

Knowledge official website address:

Developer.harmonyos.com/cn/docs/doc…

1 Creating a Project

  1. Open the development tool DevEco Studio, choose File -> New -> New Project

  1. Select ability template, we select Empty Ability(Java)

  1. Enter the Project Name Project Name, Package Name Package Name, Project storage path Save Location, Device Type(I selected Phone here), and click Finish!

  1. After the project is created, you will see the following projects

2 Start the remote emulator

HarmonyOS currently only supports remote debugging, which is why we need to log in to our Huawei account (if you don’t have one, you can verify it with your real name, which was explained in detail in my last article). , open the simulator for preview debugging, each debugging time is one hour, one hour after the recovery of resources, if there is a need to restart the start!

  1. Choose Tools > Device Manager to enter the Device selection screen

  1. Click Login, the browser will open automatically and the Login page will be displayed

  1. Log in using an authenticated account and password

  1. When you log in, credit will pop up, so we can click allow!

  1. You will see the following page, which indicates that the login is successful, but does not mean that the remote emulator has been successfully started!

  1. Go back to the Console in DevEco Studio and see the following output. Success! If Login fails, go to the browser to clear the session, and click Login again to Login.



7. After successful login, select P40 and click the green start button on the right!

  1. At this time, the remote emulator of P40 will appear on the right side of DevEco Studio, and the code we developed will be displayed on this page. The top of the phone will count down the time of each debugging. When the time is up, you can restart the remote emulator!

3 Running Projects

  1. Click on the triangle in the upper right corner to run the project directly, or click on Beetle to enter debug mode. After clicking, the project will be built through Gradle and wait a while.

  1. At this point, the remote emulator displays the project output — “Hello world,” and the first project runs successfully!

  1. To modify the output, go to SRC ->main->resources->zh-> Element ->string.json