Is Hongmeng OS a “shell” Android? 2.0 Open Source! 4.6 million lines of code take you to reveal the secret
In 2017, with 153 million mobile phone sales and a 20.4% market share, Huawei’s mobile phone market is firmly in the position of the leader in China’s mobile phone market.
While everyone was celebrating this milestone moment, in early 2018, Wang Chenglu, the head of Huawei’s consumer business software department, sent a dangerous signal to Ren Zhengfei: Huawei did not have the “foundation” to match the huge mobile phone business. Huawei needs its own operating system.
Ren Zhengfei immediately decided to upgrade the “operating system project” that he had been planning from an internal project of the software department to a company project.
Two years later, on August 9, 2019, Yu Chengdong celebrated his 50th birthday. It has been 4 months since the United States first sanctioned Huawei. On the same day, Huawei unveiled the Hongmeng system at the developer conference. The photo of Yu Chengdong’s birthday cake and the name of Hongmeng spread all over social networking sites.
Hongmeng was born at the moment of Huawei’s glory, and came to the front when Huawei was in crisis.
As Huawei’s self-developed OS, Hongmeng has always been controversial, but whether it is the early “system living in PPT” or the later “Android shell”, the public has expectations and doubts about Hongmeng.
In the context of the global contraction of Huawei’s mobile phone business, Hongmeng is about to usher in a huge crisis in the toddler period.
Hongmeng 2.0 4.6 million lines of code open source one after another
With the recent gradual push of the Hongmeng system to the mobile phones of ordinary users, the debate on Hongmeng has intensified. Many netizens think that Hongmeng is a shell Android, but it is difficult to verify because the code is not open source.
A few days ago, according to the latest news from Weibo @銊哥科科技, the new Hongmeng OpenHarmony 2.0 will be open sourced from May 16 to June 2.
Previously, Huawei announced at the developer conference that it would donate the source code of HarmonyOS to the China Open Atomic Open Source Foundation, and announced the open source route of the Harmony OS at the conference, which is OpenHarmony.
OpenHarmony official source address:
According to the introduction on Gitee, based on the traditional single-device system capabilities, OpenHarmony creatively proposes the concept of adapting to multiple terminal forms based on the same set of system capabilities, and supports running on multiple terminal devices. The first version supports 128K Running on ~128M devices, welcome to join the open source community for continuous evolution.
For device developers, OpenHarmony adopts a componentized design scheme, which can be flexibly tailored according to the resource capabilities and business characteristics of the device to meet the operating system requirements of different types of terminal devices. It can run on resource-constrained devices and wearable devices at the 100K level, and can also run on relatively resource-rich devices such as 100M-level smart home cameras/driving recorders.
Last month, Huawei released OpenHarmony 1.1.0 LTS version, which added AI subsystem, power management subsystem, pan-sensor subsystem, upgrade subsystem, and unified AI engine framework compared to the earlier 1.0 version.
According to Zhaoge Science, OpenHarmony 2.0 has about 4.6 million lines of key code, compared with 15.25 million lines in Android 10; OpenHarmony 2.0 has about 18,000 APIs, compared with 36,000+ in Android 10. The size of the installation package is reduced to 60-70%, and various devices such as mobile phones, tablets, wearable devices, TVs, sensors, etc. can be used.
According to his revelations, OpenHarmony 2.0 will have multiple branch versions. This time the open L2 is a pure Hongmeng version, and the open source of the OpenHarmony L2 code has begun, and millions of aviation codes are coming. The pure Hongmeng version does not have any Android code and can use all Hongmeng applications, but it is relatively scarce on the APP.
There will also be L3-L5 versions, which are dual-framework compatible with Android. It is the one that can run Android apk applications before, and it will be open source soon. “As for whether this Hongmeng is the Android that many people think of as a shell, you can see it in the code, touch the code, and spray it at a time,” he said excitedly.
In terms of ecology, more and more units will join the ranks of Hongmeng, such as China Academy of Information and Communications Technology, iSoftStone, Haoba Technology, Huaqiu Electronics, Chinasoft, Runhe Software, Jiulian Technology, and so on.
Finally, there is a relevant introduction to why Hongmeng is compatible with Android applications. According to the PPT picture disclosed by Zhaoge Science, this is because OpenHarmony 2.0 reuses multiple open source components, starts the Foundation process in a timely manner, and then processes it further within the process.
At the beginning of May, the developer version of Hongmeng OS 2.0 has been publicly tested one after another, and flagship phones such as Mate 40 have received system push, and the follow-up Huawei nova 6, nova 6 5G, nova 7 5G, nova 7 Pro 5G, nova 8, nova 8 Pro, MatePad 10.8 Inches and other models will also be supported.
And OpenHarmony has also been innovating. The OpenHarmony version road sign is as follows:
Regarding this news, some people on Zhihu expressed doubts, but Brother Zhao thought that the L2 could be used on the mobile phone and took it out immediately.
Is it casing?official response
Regarding the question of whether Hongmeng is a casing, Huawei has publicly spoken out many times before. In an interview with domestic media, Wang Chenglu, president of Huawei’s consumer business software department and head of the Hongmeng operating system, said that in fact, everyone questioned whether Hongmeng has changed its shell to Android, which shows that the Chinese technology community does not have a consistent understanding of software open source.
He added that not all Android code is developed by Google, and the vast majority of it comes from the open source community. Hongmeng will also absorb the excellent technologies and codes of the community, and use the open source code of AOSP (Android Open Source Project) to judge that Hongmeng has changed its skin from Android, indicating that such complainers do not have a very accurate understanding of what open source is.
He emphasized that the emergence of Hongmeng OS is not an alternative system to deal with US sanctions, but was established and developed in 2016. It is a panoramic operating system that truly faces the future IoT era.
In fact, compared to other mobile systems, the Hongmeng system is indeed quite different. In terms of hardware carriers, the largest iOS and Android in the market mainly face mobile phones and tablets, while Hongmeng can be mounted on any IoT devices such as TVs, watches, cars, and smart homes.
Huawei emphasized that Hongmeng OS is different from the traditional iOS and Android systems in concept. It is positioned as an operating system in the era of the Internet of Everything, oriented to all scenarios, including smart wearables, household appliances, cars, TVs, etc.
Yang Haisong, vice president of Huawei’s Consumer Business Software Department, once pointed out that the ultimate goal of HarmonyOS is to help developers and make developing cross-end applications as easy as developing single-end applications!
To achieve this goal, three major components have been released, namely the distributed application framework, the distributed UI framework, and the DevEco Studio tool platform. He emphasized, “At the beginning of its design, HarmonyOS is an operating system for the future era of the Internet of Everything. HarmonyOS’s opponent is not Android, nor iOS, but the ecological shackles of the Internet of Everything era.
Distributed application framework: One-time development and multi-terminal deployment. HarmonyOS 2.0 mobile phone application developer beta version, through the distributed application framework and more than 15,000 APls, encapsulates the complex inter-device collaboration into a simple interface, realizes the characteristics of one-time development and multi-terminal deployment, and avoids developers from different devices. repeated development.
Distributed UI framework: Double the development efficiency. The distributed UI framework can provide 7 types of adaptive layout capabilities of stretching, scaling, hiding, folding, dividing, proportioning, and extending, which greatly improves the efficiency of cross-end UI development; at the same time, there are different interactions for various devices. In this way, the normalized control design of HarmonyOS also allows developers to only focus on the interaction itself, helping cross-end interactive development.
DevEco Studio: Easy cross-end development and debugging. The new version of the integrated development tool DevEco Studio 2.0 Beta3 has four major functions: firstly, it integrates 9 sets of mobile phone application templates, covering application scenarios such as news and shopping, which can reduce the code input by more than 1,000 lines; secondly, it has multi-terminal interface preview and real-time feedback Function, developers can see the preview effect of multiple interfaces in real time, which doubles the efficiency of front-end development; the third is distributed debugging, which can diagnose errors in the distributed application development process, and analyze and locate faults for abnormal codes. The fourth is to support realistic simulation of more than 20 devices and sensors, including continuous navigation, continuous step counting, and mobile network (receiving text messages/calls) and other scenarios, the simulation is infinitely close to the real machine, allowing application developers to develop and adjust across terminals. The measurement efficiency is greatly increased.
The difference between Hongmeng and Android measured
In fact, some netizens have actually measured the difference between Hongmeng and Android:
Development tools: Hongmeng uses DevEco Studio, which is deeply customized based on Intellij IDEA, as its development tools.
So, in the application development process, what is the difference between HarmonyOS (Hongmeng) and Android (Android) development environment?
1. Comparison of HarmonyOS project and Android project:
1. Changes to the resource directory
①The name of the resource directory has been changed.
Android res directory, Hongmeng uses resources directory, including base and rawfile, of which base is the core resource directory, and commonly used ones are placed here, which is easy to find and use. rawfile will be packaged into the generated application intact.
Android is the res/values directory, Hongmeng is the resources/element directory.
Android raw directory, Hongmeng uses rawfile directory.
②Resource catalogs are classified and managed uniformly.
The Android directory structure is relatively loose, there is no unified folder management, and xml files of various resources can be created in the res/values directory. You can only go to the official website to see what can be created.
Hongmeng has a unified management of the base directory.
③Delete some resource directories and add some resource directory types.
Such as float.json file, plural.json file, profile folder, etc.
④The writing method has changed, xml is changed to json.
Android’s values are written in xml, and Hongmeng is in the element directory, all in json format.
Comparison of the same type of resources:
The specific change comparison of the complete resource directory is shown in the following figure:
2. Configuration file changes.
The manifest file AndroidManifest becomes the config.json file.
3. Changes to Java code
The complete Java directory change comparison is shown in the following figure:
2. Comparison of HarmonyOS project and WeChat applet project
The complete JS directory and WeChat applet comparison are shown in the following figure:
It is believed that with the complete disclosure of the code, whether Hongmeng OS is an Android shell can be clearly verified.
The operating system that reigns supreme in the PC era is Microsoft. In the mobile Internet era, Android and Apple are divided into two parts. It remains to be seen who will be the ultimate winner in the Internet of Things era.
But no matter whether Hongmeng can finally realize the idea of a unified IoT system. When the domestic operating system is almost blank, the birth and availability of Hongmeng itself is a milestone in resisting the crisis.