tauri
tauri copied to clipboard
[feat] Add support for Huawei WebView / HarmonyOS
Describe the problem
Following U.S. sanctions, Huawei shifted to its own operating system. For the Western market, this is based on a modified version of AOSP (Android Open Source Project), while in China, Huawei has developed a fully custom OS known as HarmonyOS.
Now, Huawei is preparing to release HarmonyOS NEXT. I am unsure whether the builds will be compatible with Huawei devices, given that they use a proprietary WebView (especially on the forthcoming HarmonyOS NEXT).
Is there any plans to support Huawei's WebView across these platforms ?
Describe the solution you'd like
- Adding support for Huawei WebView on Emui and HarmonyOS
- Adding support for the webview used for HarmonyOS NEXT
Alternatives considered
Not bringing support for these devices
Additional context
2024/10/14 update: adding new solutions as HarmonyOS NEXT β is releasing soon.
It shouldn't be a problem at this point. However, Huawei is about to release HarmonyOS Next, which will use will ArkTS or Cangjie to write apps and may not be compatible with all Android apps.
Links
OS
- HarmonyOS: https://developer.huawei.com/consumer/cn/ (Chinese only)
- OpenHarmony
- Website: https://www.openharmony.cn/ (Chinese only)
- Sources: https://gitee.com/openharmony
- Oniro:
- Website: https://oniroproject.org/ (English only)
- Mirrors: https://github.com/eclipse-oniro-mirrors
- For OpenHarmony: https://github.com/eclipse-oniro4openharmony
Languages
- Cangjie
- Website: https://developer.huawei.com/consumer/cn/cangjie (Chinese only)
- Sources: https://gitcode.com/Cangjie
- ArkTS: https://developer.huawei.com/consumer/cn/arkts (Chinese only)
Development
- HarmonyOS NEXT Guides: https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/application-dev-guide-V5 (Multilingual)
- OpenHarmony Guides: https://docs.openharmony.cn/pages/v5.0/en/application-dev/application-dev-guide.md (Multilingual)
The following content is to provide some background information. There's nothing like a to-do list here.
HarmonyOS is the system used by Huawei, a Chinese company. they introduced their backup system called HarmonyOS. The version Huawei contributed to open-source organizations is called OpenHarmony. Their relationship is similar to that of Android and AOSP. Previously, HarmonyOS included AOSP for transition purposes, allowing Android applications to be installed seamlessly. However, Huawei has now launched a new version, currently called HarmonyOS NEXT, which has removed AOSP and no longer supports Android applications. They have gone their separate ways, and due to Huawei's large market share in China, they seem to be able to do this successfully. After taking this approach, top applications in China have started redeveloping. It's said that the first batch includes over 4,000 top applications, satisfying 99% of usage needs. Some users are already in the beta testing phase, and progress is going smoothly. Public beta testing will begin on October 8, 2024, when it will be pushed to mobile users. It's expected to be officially released in November along with the Mate 70. News reports suggest that previously released phones will also support upgrading to HarmonyOS NEXT. At this point, developers in China will need to develop applications for an entirely new platform, similar to iOS, Android, and HarmonyOS, creating such a landscape. HarmonyOS is a unique existence. Unlike macOS, iOS, and iPadOS which are categorized separately, it's a single system that simultaneously supports phones, tablets, watches, TVs, HiCar, and soon, PCs. Additional information: In terms of mobile devices alone, HarmonyOS has already surpassed Apple's iOS market share in China, where Apple phones have a significant presence.
Just to correct the above message, Apple uses coreOS for all their operating systems.
It's pretty similar on how Huawei is using HarmonyOS with their devices where they use "layers" of Harmony based on what kind of device it will be running on.
In the Apple case, they just brand it with a different name but they use the same base.
@FabianLars Wait, I don't think this issue has anything to do with the issue of adapting HarmonyOS NEXT such as #11112.
This issue is a request to tauri to consider the compatibility of Hawei WebView (a fork of Android WebView, usually of an older version) for HarmonyOS's Android app, since Huawei is no longer using Google WebView or Android WebView, instead of supporting the new HarmonyOS NEXT platform.
@Jesse205 it was opened a while back when NEXT wasn't ready at all but the main goal of that issue was to port compatibility to HarmonyOS indeed and so NEXT too.
As they were still using a forked android webview I mainly talked about it instead of what they will use because we had little to no infos about it.
Hope it clarifies my intentions with it.
I should probably update the solution wanted for it too to avoid any further confusion.
I understand, but I still think these should be split into two different issues. One is to make existing android apps better adapted to HarmonyOS 2.0-4.2, and the other is to make the tauri project able to be packaged as a HarmonyOS NEXT app
So then is it really worth it spending time on huawei webview integration knowing that it would be obsolete in some month?
I don't know if it would make you guys spend a lot of time on it knowing that it is a modified android webview?
As again as this issue is a year old, I didn't plan NEXT to come that fast and to be deployed even to western devices.
I see that everyone is talking about HOS and I think it's time to directly support the next system as Huawei may export its latest next system capabilities to overseas models. They did this before, 3.0-4.2 support api8/9?
I see that everyone is talking about HOS and I think it's time to directly support the next system as Huawei may export its latest next system capabilities to overseas models. They did this before, 3.0-4.2 support api8/9?
I don't recommend calling HarmonyOS HOS, because there are other OSes that start with H, such as HyperOS, and the official abbreviation for HarmonyOS is HMOS (which used to appear in app icons, officially similar to the Android's "Now In Android" demo "HMOS Vision" is also using this abbreviation).
Supporting ohos requires detailed planning.
can we try the Open Harmony OS (OHOS) platform ? OHOS is an open-source operating system, and Huawei Harmony OS Next is a derivative version of OHOS
can we try the platform ? is an open-source operating system, and Huawei Harmony OS Next is a derivative version of
Open Harmony OS (OHOS)``OHOS``OHOS
Umm, we can try Harmony OS Next simulator on the Huawei official IDE (DevEco Studio https://developer.huawei.com/consumer/en/download/), it seems like another version of IntelliJ IDEA, so it support any language on Intellij. But we almost have no chance to try it on any other devices which is not huawei official devices... Oh, by the way, huawei releases their new PC OS also names Harmony OS NEXT.. so I think it's the time to support it, and our team is trying to
I see that everyone is talking about HOS and I think it's time to directly support the next system as Huawei may export its latest next system capabilities to overseas models. They did this before, 3.0-4.2 support api8/9?
I don't recommend calling HarmonyOS HOS, because there are other OSes that start with H, such as HyperOS, and the official abbreviation for HarmonyOS is HMOS (which used to appear in app icons, officially similar to the Android's "Now In Android" demo "HMOS Vision" is also using this abbreviation).
We can call HMOS and OHOS instead of HOS, HMOS is the released and close source os, and OHOS is Open Harmony OS
For now, HMOS released the desktop version, it's based on arm only for now. We want our project to support this system. Here are some ideas we’ve been thinking about to make it happen:
- What if we transpile our entire frontend tech stack—like JavaScript, TypeScript, Vue, etc.—into ArkTS, then compile it in DevEco? Would that kinda… get the job done in a weird way?
- Huawei is a Platinum founding member of the Rust Foundation, and DevEco already supports cross-development with Rust. The catch is, we’d need to manually adapt a ton of dynamic libraries.
- Maybe we could treat this like iOS development—think of DevEco as Xcode or Android Studio.
- If we can transpile to DevEco, it’d probably handle cross-platform (desktop/mobile/tv/pad) adaptation on its own since it natively supports "code once, adapt everywhere." But we’d likely need to tweak some config options.
- In China, tons of software individually embed their own CEF instances – it’s downright disgusting. If we pull this off, given HarmonyOS’s potential for massive adoption, and leveraging Tauri’s cross-platform capabilities… we could actually change the game.
- We’ve started exploring this—still super early stage though. We forked Tauri’s repo and are messing with it (privately for now). It’d be awesome if we with tauri on this!
Okay, so right now, DCloud's Uni-App already supports HarmonyOS Next – built on OpenHarmony – at least for mobile. Not totally sure about desktop support yet, gonna test that tomorrow.
Here’s their official site: https://en.uniapp.dcloud.io/.
Cool thing is, you can use Vue as your frontend tech stack with Uni-App. And for the backend? Looks like they're using Node.js – haven’t dug deep into that part though.
Oh, and about OpenHarmony’s webview: It’s called ArkWeb, and under the hood, it’s based on Chromium and CEF. The source code’s hosted here: https://gitee.com/openharmony/web_webview – heads up, the website only in Chinese for now.
Hi everyone, just jumping in to say — I’ve been closely following the development of both HarmonyOS (HMOS) and OpenHarmony (OHOS), and I'm quite familiar with their application ecosystem and runtime layers.
One month ago, Huawei officially open-sourced their Electron adaptation for OpenHarmony: 👉 https://gitcode.com/openharmony-sig/electron
This project enables running Chromium-based apps in OpenHarmony environments, and it's aligned with their ArkWeb / CEF direction. I believe it might provide a good entry point for adapting tools like Tauri to the HarmonyOS NEXT ecosystem.
I'm happy to collaborate or contribute ideas, especially on cross-layer adaptation or evaluating feasibility from a native/runtime integration standpoint.
@ashreo Please refrain yourself from spamming comments that aren't directly related to the issue
I've drafted a technical architecture based on the ArkWeb NDK Page Data Channel documentation, aiming to integrate HarmonyOS native APIs with Tauri-style web frontends.
The core idea is to keep the web frontend untouched (still calling invoke()), while internally bridging the communication via ArkWeb's WebMessagePort APIs through a layered approach:
graph TD
A[Web Frontend - invoke greet]
A --> B[tauri-bridge.js Adapter]
B --> C[WebMessagePort API]
C --> D[C++ Native Bridge - ArkWeb_ControllerAPI]
D --> E[extern C interface]
E --> F[Rust Core Logic]
This setup preserves Tauri's developer experience, while allowing access to HarmonyOS-specific native capabilities. The architecture is designed to be modular, cross-platform compatible, and suitable for future Rust+C++/Harmony integrations.
Would love to hear your thoughts on whether this approach aligns with the community's direction, or if anyone has explored something similar.
To take this idea a step further, perhaps we could start with a minimal MVP demo — just enough to validate the core communication flow.
To take this idea a step further, perhaps we could start with a minimal MVP demo — just enough to validate the core communication flow.
Would you need any help for that, I basically have unlimited free time at the moment.
在这一点上应该不是问题。不过,华为即将发布HarmonyOS Next,它将使用ArkTS或仓颉编写应用程序,可能无法兼容所有Android应用程序。
链接
操作系统
- HarmonyOS:https://developer.huawei.com/consumer/cn/(只有中文)
- 开放和谐
- 网站:https://www.openharmony.cn/
- 来源:https://gitee.com/openharmony
- 鬼郎:
- 网站:https://oniroproject.org/(仅英文)
- 镜子:https://github.com/eclipse-oniro-mirrors
- 对于 OpenHarmony:https://github.com/eclipse-oniro4openharmony
语言
- 仓颉
- 网站:https://developer.huawei.com/consumer/cn/cangjie
- 资料来源:https://gitcode.com/Cangjie
- ArkTS:https://developer.huawei.com/consumer/cn/arkts(仅中文)
发展
- HarmonyOS NEXT 指南:https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/application-dev-guide-V5(多语言)
- OpenHarmony 指南:https://docs.openharmony.cn/pages/v5.0/en/application-dev/application-dev-guide.md(多语言)
It shouldn't be a problem at this point. However, Huawei is about to release HarmonyOS Next, which will use will ArkTS or Cangjie to write apps and may not be compatible with all Android apps.
Links
OS
HarmonyOS: https://developer.huawei.com/consumer/cn/ (Chinese only)
OpenHarmony
- Website: https://www.openharmony.cn/ (Chinese only)
- Sources: https://gitee.com/openharmony
Oniro:
- Website: https://oniroproject.org/ (English only)
- Mirrors: https://github.com/eclipse-oniro-mirrors
- For OpenHarmony: https://github.com/eclipse-oniro4openharmony
Languages
Cangjie
- Website: https://developer.huawei.com/consumer/cn/cangjie (Chinese only)
- Sources: https://gitcode.com/Cangjie
ArkTS: https://developer.huawei.com/consumer/cn/arkts (Chinese only)
Development
- HarmonyOS NEXT Guides: https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/application-dev-guide-V5 (Multilingual)
- OpenHarmony Guides: https://docs.openharmony.cn/pages/v5.0/en/application-dev/application-dev-guide.md (Multilingual)
You can find the development documentation for the English version of HarmonyOS here: https://developer.huawei.com/consumer/en/doc/harmonyos-guides/application-dev-guide
To take this idea a step further, perhaps we could start with a minimal MVP demo — just enough to validate the core communication flow.更进一步来说,或许我们可以从一个最小化的 MVP 演示开始——只需验证核心通信流程即可。
Would you need any help for that, I basically have unlimited free time at the moment.如果需要帮忙的话,我现在基本上有无限的空闲时间。
But I might be a bit short on time.
I would like to help as well.