Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could we support the OpenHarmony OS ? #4081

Open
1991wangyufei opened this issue Jan 14, 2025 · 14 comments
Open

Could we support the OpenHarmony OS ? #4081

1991wangyufei opened this issue Jan 14, 2025 · 14 comments
Labels
C - nominated Nominated for discussion in the next meeting S - enhancement Wouldn't this be the coolest?

Comments

@1991wangyufei
Copy link

Description

HarmonyOS, the Greatest self-innovated OS in China, will soon be popular around the world. HarmonyOS has an absolutely leading user base in China and a very broad development prospect, demonstrating exceptional capabilities. So, I sincerely hope winit can support it, Thanks.

Relevant platforms

No response

@1991wangyufei 1991wangyufei added the S - enhancement Wouldn't this be the coolest? label Jan 14, 2025
@1991wangyufei 1991wangyufei changed the title Could we support the HarmonyOS, the Greatest self-innovated OS in China Could we support the HarmonyOS ? the Greatest self-innovated OS in China Jan 14, 2025
@notgull notgull changed the title Could we support the HarmonyOS ? the Greatest self-innovated OS in China Could we support the HarmonyOS ? Jan 14, 2025
@notgull
Copy link
Member

notgull commented Jan 14, 2025

We already support OpenHarmony in raw-window-handle, is HarmonyOS's windowing system any different?

@1991wangyufei
Copy link
Author

We already support OpenHarmony in raw-window-handle, is HarmonyOS's windowing system any different?

oh, that's great, I was using the old ver. of winit.. I will upgrade and have a try, Thx ! ^ _ ^

@notgull
Copy link
Member

notgull commented Jan 15, 2025

oh, that's great, I was using the old ver. of winit.. I will upgrade and have a try, Thx ! ^ _ ^

To clarify, we do not support OpenHarmony or HarmonyOS in winit. So far it is only implemented as an option in the raw-window-handle interopability layer. I was asking if there is a meaningful difference between HarmonyOS and OpenHarmony.

@1991wangyufei
Copy link
Author

oh, that's great, I was using the old ver. of winit.. I will upgrade and have a try, Thx ! ^ _ ^

To clarify, we do not support OpenHarmony or HarmonyOS in winit. So far it is only implemented as an option in the raw-window-handle interopability layer. I was asking if there is a meaningful difference between HarmonyOS and OpenHarmony.

I got it, there is no meaningful difference between HarmonyOS and OpenHarmony. By the way, one more question is that, as we
known, winit is using android-activity as the upper layer to interact with the raw-window-handle on Android, is there any upper layer similar to android-activity, to interact with raw-window-handle on OpenHarmony using by winit ? Thx.

@notgull
Copy link
Member

notgull commented Jan 15, 2025

I am not aware of such a layer if it exists.

@madsmtm
Copy link
Member

madsmtm commented Jan 15, 2025

A quick search reveals at least two GitHub orgs, with a bunch of crates related to this stuff:

@1991wangyufei
Copy link
Author

A quick search reveals at least two GitHub orgs, with a bunch of crates related to this stuff:

Yes, I have noticed this too. Maybe we can create a new glue layer in winit, for OpenHarmony platform, to connect to the upper app layer, just like android-activity or game-activity crate used by winit for Android platform.

@nicoburns
Copy link
Contributor

CC: @jschwe who has been implementing OpenHarmony support in Servo. How is Servo doing windowing on OH?

@jschwe
Copy link

jschwe commented Jan 17, 2025

I was asking if there is a meaningful difference between HarmonyOS and OpenHarmony.

It's basically the same as Android vs AOSP. Supporting OpenHarmony means HarmonyOS is also supported, since any OpenHarmony based OS must be a superset

How is Servo doing windowing on OH?

Servo is not using winit on OH or android right now, but just doing a custom embedder.

I know that @richerfu (Maintainer of ohos-rs) has been working on adding OpenHarmony support to winit though. I'm not sure what the current progress is and if it is far enough along to open a pull request, but perhaps he can comment here what his plan is.

@richerfu
Copy link

richerfu commented Jan 17, 2025

Yes, I'm working on adding OpenHarmony support to winit. At present, we can successfully run winit and glutin-winit(0.30.x). However, there's still work to be done.

  1. Some APIs need to be supported, and we need more examples to test these APIs.
  2. Code cleanup is necessary, as our current code relies on Mutex to handle event callbacks, which impacts performance.

I'll try to mark repo as public and submit a draft PR for winit and glutin-winit as soon as possible. Then all of us can help it be better.
That's all, thanks :)

Here is an example pic for it.
Image

@richerfu
Copy link

A quick search reveals at least two GitHub orgs, with a bunch of crates related to this stuff:

Yes, I have noticed this too. Maybe we can create a new glue layer in winit, for OpenHarmony platform, to connect to the upper app layer, just like android-activity or game-activity crate used by winit for Android platform.

Yep i create a repo named openharmony-ability for it.

@richerfu richerfu mentioned this issue Feb 7, 2025
4 tasks
@madsmtm madsmtm added the C - nominated Nominated for discussion in the next meeting label Feb 20, 2025
@madsmtm
Copy link
Member

madsmtm commented Feb 20, 2025

Thanks for the PRs to softbuffer and winit, @richerfu. I think that it makes sense to have this in-tree, but we (the maintainers) will probably have to discuss it at a meeting first (which is in general really overdue 😬).

I have not looked at the code yet, at this point I'm more interested in the meta stuff:

  • What's the difference between the names "OpenHarmony" and "OHOS"? And which is preferred?
  • From my understanding, OpenHarmony is sort of forked from Android? Would it make sense to try to share code between these two platforms?
  • Who will be maintaining the backend going forwards? (If you, please add yourself to .github/CODEOWNERS in the PRs).
    • And for how long do you think you'll be able to?
  • What is your personal motivation for adding this backend / your relationship with OpenHarmony? Employer?
  • Where is the canonical documentation? Is it https://gitee.com/openharmony/docs/blob/master/en/application-dev/Readme-EN.md?

Also, for my own understanding of the platform (since if we get this in-tree, I will have to learn about it):

  • Could you point me to links about the application/window lifecycle (or is it just the same as Android)?
  • Is there an equivalent of AndroidManifest.xml?

@kchibisov
Copy link
Member

I'd generally prefer for platforms to be out of tree, once we're ready, which should be relatively soon. Especially given that community is likely a bit different language vise and it would be simpler to handle it out of tree wrt issues/etc? And for example you won't need github for that.

It's just at the current state it's required, but I hope to change that next month.

@1991wangyufei 1991wangyufei changed the title Could we support the HarmonyOS ? Could we support the OpenHarmony OS ? Feb 21, 2025
@richerfu
Copy link

What's the difference between the names "OpenHarmony" and "OHOS"? And which is preferred?

OHOS is equal to OpenHarmony, sometimes OpenHarmony looks too long for variable or name, so we can use ohos. For example, rust's target use ohos.

From my understanding, OpenHarmony is sort of forked from Android? Would it make sense to try to share code between these two platforms?

In fact, it's should be NO. OpenHarmony is not forked from Android. It operates more like Node.js, with its runtime capabilities being provided by the foundational Linux compatibility layer. You can see the Technical Architecture

So i think it's difficult to shared code between OpenHarmony and Android.

Who will be maintaining the backend going forwards

Maybe should myself, i'll check it with some peoples and groups and add it this weekend.

What is your personal motivation for adding this backend / your relationship with OpenHarmony? Employer?

Now i'm a chinese developer working for adaption HarmonyNext which is a bussniess OS based OpenHarmony. I wish openharmony could be developed using superior programming languages. That's why I've established groups like ohos-rs and openharmony-contrib, aiming to adapt openharmony to the rust ecosystem.

Note: HarmonyNext and OpenHarmony is similar to Android and AOSP.

Where is the canonical documentation?

Your link is the origin document and you can see the formatted documents with overview and Application development

Could you point me to links about the application/window lifecycle

Here are some documents:
lifecycle document
ability lifycycle callback API

Is there an equivalent of AndroidManifest.xml?

I think you can see the document and https://docs.openharmony.cn/pages/v5.0/en/application-dev/quick-start/start-with-ets-stage.md. It provides app.json5 module.json5 and build-profile.json5 to configurate the application.

That's all and you can ask me any questions about OpenHarmony or HarmonyNext @madsmtm Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - nominated Nominated for discussion in the next meeting S - enhancement Wouldn't this be the coolest?
Development

No branches or pull requests

7 participants