I’m referring to this code lab here: Cloud Functions for Android Besides that “configure the following address” appears to be a wrongful CN to EN translationand that I’m using the current version 1.6.0.300 instead; the IDE gives me these imports: Please don’t close for requesting a library; because it is “simply not there” (see the screenshot), despite the AAR is
Tag: huawei-developers
What is the equivalent of view.postDelayed(Runnable action, long delayMillis) in harmonyos?
I am creating a custom component in HarmonyOS using Java SDK, Where I have to perform some task after some delay with Component instance. In Android, we have postDelayed(Runnable action, long delayMillis) method in View class. So we can achieve above requirement as follow but, In HMOS java SDK, I seen there is no any api available for delay in
How to add image inside a tab as a icon while developing Harmony application?
I want to add an image inside the tab and I have Image Resource Id but tab.setIconElement(Element) takes element. currently, I am trying like this How can I add an image inside the tab or create its element with Image Resource Id only? Or is there any other way to do it? Answer First you have to decode the Image
What is the alternative in Harmony OS for Nullable and NonNull annotations?
There are many arguments in my code which can take the value null. It would be helpful if there is a @Nullable and @NonNull annotation like the ones offered in Android via Annotation. Is there an alternative available in Harmony OS? Answer You can use org.jetbrains.annotations.Nullable & org.jetbrains.annotations.NotNull annotations available from jetbrains dependency, implementation ‘org.jetbrains:annotations:20.1.0’
What is the alternative in Harmony OS for function setBackgroundColor() on View class in Android?
I am working on a HarmonyOS project in that I wanted to set the background color of the component. In Android we have a function setBackgroundColor() in the View class, this can be done as shown below. How can I set background color to a component in HarmonyOS? Answer First you have to build an Element using some color, later
How much 1px is with respect to fp in Harmony OS?
Can anyone tell px:fp ratio or code to convert fp to px. I am building a HarmonyOS application and I want to set the width of a component to 20fp but setWidth​(int width) takes width in px. Answer HarmonyOS provides the AttrHelper tool class to implement conversion between fp and px. AttrHelper.fp2px() For more details, pls kindly refer to this