Huawei HCIP-HarmonyOS Application Developer V1.0 Sample Questions:
1. In the declarative development paradigm, which of the following decorator decorated state variables needs to be initialized locally, and the initialized value can be overridden by the construction parameters?
A) @ObjectLink
B) @Prop
C) @StorageLink
D) @State
2. What events can the next piece of code handle?
A) public class CustonLomponent extends Componentimplements
Component.DrawTask,Component.EstimateSizeListener,Component.TouchEventListener
{
......
public CustomComponent (Context context){
...
Set up a TouchEvent to respond to events
setlouchEventListener(this);
}
...
@Override
public boolean onTouchEvent(Component
component,TouchEvent touchEvent){
switch (touchEvent.getAction() {
case TouchEvent.PRIMARY_POINT_DOWN:
circ1ePaint.setColor(Color.GREEN);
invalidate() ;
break;
case TouchEvent.PRIMARY_POINT_UP:
circlePaint.setColor(Color.YELLOWV);
invalidate();
break ;
}
return false;
}
}
BothDOWN and UP events can be handled normally
B) can only handle DOWN events
C) Only UP events can be processed
D) Neither event can be processed
3. During the development of a HarmonyOS application, a developer needs to obtain the uplink and downlink traffic of a specified NIC. Which of the following interfaces does the developer need?
A) getAllTxBytes()
B) getlfaceRxBytes(String nic)
C) getlfaceTxBytes(String nic)
D) getAllRxBytes()
4. In order to test the distributed file service functions of application A and application B, the developer installs application A and application B on both device 1 and device 2. During the test, application A on device 1 creates a distributed file X, and application B on device 2 creates a distributed file Y. Which of the following descriptions of this scenario is wrong?
A) With distributed file services, application A on device 1 is able to read and write file Y on device 2
B) If Device 1 and Device 2 are logged in to different HarmonyoS accounts, distributed file sharing cannot be implemented
C) If device 1 runs out of power and causes the device to go offline, distributed file X cannot be accessed
D) ApplicationA and Application B need to apply for ohos.permission.DISTRIBUTED_DATASYNC permissions to use the full functionality of the distributed file service
5. Which package is imported using the preferences?
A) @ohos.router
B) @ohos.data.preferences
C) @ohos.data.rdb
D) @ohos.data.storage
Solutions:
| Question # 1 Answer: D | Question # 2 Answer: A | Question # 3 Answer: B,C | Question # 4 Answer: A | Question # 5 Answer: B |
We're so confident of our products that we provide no hassle product exchange.


By Joy

