HarmonyOS is a family of operating systems developed by Huawei to developer as part of the initiatives for the all-scenario strategy, adaptable to mobile office, fitness and health, social communication, and media entertainment, to name a few. HarmonyOS is built on a distributed architecture designed based on a set of system capabilities. It is able to run on a wide range of device forms, including mobile phones, tablets, wearables, smart TVs, head units.
Questions tagged [harmonyos]
131 questions
1
vote
1 answer
How to get the screen width and height of the device in HarmonyOS?
In HarmonyOS, I am trying to create a commonDialog and add a stackLayout of screen size to it. This layout helps me to move a component (for example., an image) to any location on the screen. To do so I need the width and height of the entire…

Narla Komal Kalyan
- 37
- 4
1
vote
1 answer
How to create custom attributes for a custom component that can be assigned from XML in HarmonyOS?
I am implementing a custom component and trying to take input from XML for an attribute. In Android, it looks something like this

YOGESH SANKU
- 51
- 5
1
vote
2 answers
What is the alternative function in HarmonyOS for onDraw in Android OS?
I am implementing a custom component in HarmonyOS using Java SDK. In Android to draw a custom view, we override the onDraw method from the View class.
In HarmonyOS the Component class doesn’t have the onDraw method. How to resolve it?

YOGESH SANKU
- 51
- 5
1
vote
1 answer
How to get the touch coordinates of a touch event in HarmonyOS?
I am writing a helper class to zoom an image in HarmonyOS using Java SDK. I want to get the touch coordinates of the dispatched touch, in Android we can use the following code snippet.
MotionEvent.PointerCoords pointerCoords = new…

Narla Komal Kalyan
- 37
- 4
1
vote
1 answer
How to load color resource using Resource ID in HarmonyOS?
I am building a HarmonyOS application and want to load color values that I have placed in the resources folder in resources/base/element/color.json. How can I load this color in my Java class?
In Android we can use the getColor() function for…

Soham
- 37
- 5
1
vote
1 answer
What is the alternative in HarmonyOS for window.setDimAmount() in Android?
To set the background dimness of a component like dialog box, in Android we can use the setDimAmount function.
dialog.getWindow().setDimAmount(0.5);
What is the alternative for this in HarmonyOS?

Soham
- 37
- 5
1
vote
2 answers
How to find the swipe direction of PageSlider while the user starts swiping the page in HarmonyOS?
I am writing a custom component in HarmonyOS using Java SDK and it is a custom page slider indicator. To do that I have added a PageChangedListener which provides three override methods.
public class CustomPageSliderIndicator extends Component…

YOGESH SANKU
- 51
- 5
1
vote
1 answer
What is the alternative in HarmonyOS for activity.findViewById(android.R.id.content) in Android OS?
I am writing a helper class to zoom an image in HarmonyOS using Java SDK. To get the current view which is being zoomed in Android we can use activity.findViewById(android.R.id.content).
What is the alternative for the above in HarmonyOS?

Narla Komal Kalyan
- 37
- 4
1
vote
1 answer
What is the alternative function in HarmonyOS for onMeasure in Android OS?
I am writing a custom component in HarmonyOS using Java SDK.
In order to negotiate the width and height of the custom view in Android, we override onMeasure().
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {}
What…

YOGESH SANKU
- 51
- 5
1
vote
2 answers
Matomo Harmony/Huawei OS
i am using Matomo for my app analytics and was curious if it is possible to show Harmony/HuaweiOS besides the currently displayed Android and iOS on the Matomo Dashboard.
If i use a Huawei phone with their own OS right now, Matomo shows it as…

Mahsum B
- 23
- 5
1
vote
1 answer
Using Axios in HarmonyOS JS Framework for Wearables
I'm using HarmonyOs to create a (not lite) Wearable App. I want to use Axios to send requests to my server.
I was able to install the package with npm install axios and import it on the page I want to use it.
The problem I'm facing is that the whole…

Daniel
- 611
- 8
- 20
1
vote
1 answer
Can all HarmonyOS JS UI Framework styles be dynamically set?
I'm using the HarmonyOS JS UI Framework to develop a Wearable app (not lite-wearable).
I'm trying to change the border-color of a button but it does not want to react to the changing variable. I followed the documentation here.
The HML file

Daniel
- 611
- 8
- 20
1
vote
2 answers
What are similar class for below objects in Harmony OS?
Please help me for similar classes for 1. AppBarLayout, 2.Interpolator(with setInterpolator method), 3. BitmapFactory.decodeResource(res, id), 4. SpannableString, 5. ReplacementSpan in HarmonyOS.

Rudraoid
- 13
- 3
1
vote
2 answers
Will React-Native eventually support HarmonyOS?
What's going to happen now that Huawei is releasing their new OS? If it blows up, and there's a good chance it will, there'd be a massive gap in access to a whole new platform. I've chosen the easy way out and I've been developing mobile apps for…

Mike K
- 7,621
- 14
- 60
- 120
0
votes
1 answer
Huawei Push Notifications
I'm trying to implement push notification, since Hauwei does not support Firebase / Azure Notification Hubs.
As I have it at the moment, I will have a singleton class that is injected during startup that will deal the receipt of the messages and…

Java_Dude
- 97
- 9