ExamGecko
Home Home / Huawei / H14-231_V1.0

Huawei H14-231_V1.0 Practice Test - Questions Answers, Page 40

Question list
Search
Search

List of questions

Search

Related questions











When a HarmonyOS developer makes an FA call to PA, the callAbility interface returns the error 'Internal ability not register.', which of the following points needs to be checked correctly?

A.
Check whether the Ability entered on the JS side is 1
A.
Check whether the Ability entered on the JS side is 1
Answers
B.
Check whether the bundleName and abilityName entered on the JS side are the same as those entered in the AcelnternalAbility inheritance class constructor
B.
Check whether the bundleName and abilityName entered on the JS side are the same as those entered in the AcelnternalAbility inheritance class constructor
Answers
C.
In the AceAbility inheritance class, the register method is executed for the AcelnternalAbility inheritance class
C.
In the AceAbility inheritance class, the register method is executed for the AcelnternalAbility inheritance class
Answers
D.
Check whether the InternalAbility set on the JS side is 0
D.
Check whether the InternalAbility set on the JS side is 0
Answers
Suggested answer: B, C

A HarmonyOS developer created two serial task distributors, dispatchera and dispatcher_b, and also created a proprietary task dispatcher. Which of the following scenarios can cause deadlocks due to improper use of syncDispatch?

A.
On a dedicated thread, dispatchers are used for syncDispatch
A.
On a dedicated thread, dispatchers are used for syncDispatch
Answers
B.
uses dispatcherb to dispatch tasks synchronously in dispatchera tasks
B.
uses dispatcherb to dispatch tasks synchronously in dispatchera tasks
Answers
C.
In the tasks dispatched by dispatcher_a, the dispatcher_a is used again to dispatch the task
C.
In the tasks dispatched by dispatcher_a, the dispatcher_a is used again to dispatch the task
Answers
D.
The thread pool is full
D.
The thread pool is full
Answers
Suggested answer: A, C

Which of the following items is an asynchronous task dispatch method in HarmonyOS threads?

A.
asyncDispatch
A.
asyncDispatch
Answers
B.
asyncGroupDispatch
B.
asyncGroupDispatch
Answers
C.
syncDispatch
C.
syncDispatch
Answers
D.
delayDispatch
D.
delayDispatch
Answers
Suggested answer: A, B, D

When a developer designs a JavaScript login page, he needs to use Internal Ability to call Data Abiliity to verify the username and password, which of the following can be modified to complete the function?

const ABILITY_TYPE_EXTERNAL=0;

var action=0;

action.bundleName='com.huawei.loginservice'; action.abilityName='com.huawei.loginservice.LoginDataAbility';

action.messageCode=ACTION_MESSAGE_CODE_PLUS;

action.data=actionData;

action.abilityType=ABILITY_TYPE_EXTERNAL; action.syncOption=ACTION_SYNC;

var result=await

FeatureAbility.callAbility(action);

A.
action.ability Type= ABILITY_TYPE_INTERNAL;
A.
action.ability Type= ABILITY_TYPE_INTERNAL;
Answers
B.
action.abiltyType =ABILITY_TYPE;
B.
action.abiltyType =ABILITY_TYPE;
Answers
C.
const ABILITY_TYPE_INTERNAL=1;
C.
const ABILITY_TYPE_INTERNAL=1;
Answers
D.
const ABILITY_TYPE_EXTERNAL= 2;
D.
const ABILITY_TYPE_EXTERNAL= 2;
Answers
Suggested answer: A, C

When a developer is developing a smart home application, the Switch component will be used to represent the switch of some devices, and ON should be displayed on the ON status component and OFF should be displayed on the closed state component, what are the following options that can meet the requirements?

A.
Switch btnSwitch=(Switch)findComponentByld(Resource Table.ld_btn_switch); btnSwitch.setStateOffText('OFF'); btnSwitch.setStateONText('ON');
A.
Switch btnSwitch=(Switch)findComponentByld(Resource Table.ld_btn_switch); btnSwitch.setStateOffText('OFF'); btnSwitch.setStateONText('ON');
Answers
B.
<Switch...... ohos:text_state_off='ON' ohos:text_state_on='OFF'> </Switch>
B.
<Switch...... ohos:text_state_off='ON' ohos:text_state_on='OFF'> </Switch>
Answers
C.
Switch btnSwitch=(Switch)findComponentByld(Resource Table.ld_btn_switch); btnSwitch.setStateOffText('ON'); btnSwitch.setStateONText('OFF');
C.
Switch btnSwitch=(Switch)findComponentByld(Resource Table.ld_btn_switch); btnSwitch.setStateOffText('ON'); btnSwitch.setStateONText('OFF');
Answers
D.
<Switch... ... ohos:text_state_off='OFF' ohos:text_state_on='ON'> </Switch>
D.
<Switch... ... ohos:text_state_off='OFF' ohos:text_state_on='ON'> </Switch>
Answers
Suggested answer: A, D

The developer is developing a ticket booking application, and uses the slide selector Picker to select the starting point of the ticket and writes the following code.

<Picker

ohos:id='$+id:test_picker'

ohos:selected_text_color='#FFFFFF'

ohos:value='55'

ohos:max_value='10'

ohos:selector_item_num='10'

ohos:bottom_line_element='#FFFFFF'

ohos:selected_text_size='16fp'/>

A.
Set the font size of the selected Chinese version to 16fp
A.
Set the font size of the selected Chinese version to 16fp
Answers
B.
Choose the color of the Chinese text as white
B.
Choose the color of the Chinese text as white
Answers
C.
The current value is 10
C.
The current value is 10
Answers
D.
The maximum value is 10
D.
The maximum value is 10
Answers
Suggested answer: A, B, D

A developer uses ListContainer to create a list component that can be swiped, in order to improve the user experience, it needs to display the rebound effect when swiping to the beginning and end of the list, which of the following options can meet this requirement?

A.
listContainer.setReboundEffect(true);
A.
listContainer.setReboundEffect(true);
Answers
B.
<ListContainer...... ohos:rebound_effect='true'/>
B.
<ListContainer...... ohos:rebound_effect='true'/>
Answers
C.
listContainer.setReboundEffect(false);
C.
listContainer.setReboundEffect(false);
Answers
D.
<ListContainer...... ohos:rebound_effect='false'/>
D.
<ListContainer...... ohos:rebound_effect='false'/>
Answers
Suggested answer: A, B

In the game scene, when playing games on the smart screen, you can use the mobile phone as a remote control handle, and with the help of the mobile phone's gravity sensor, acceleration sensor, and touch ability, it provides players with a more convenient and smooth gaming experience. What distributed capabilities are used to use the mobile phone as a remote control controller in this scenario?

A.
Distributed Device Virtualization
A.
Distributed Device Virtualization
Answers
B.
Distributed task scheduling
B.
Distributed task scheduling
Answers
C.
Distributed file services
C.
Distributed file services
Answers
D.
Distributed soft bus
D.
Distributed soft bus
Answers
Suggested answer: C, D

When a developer sets a background for a Text component, which of the following methods are correct?

A.
ohos:basement='$graphic:graphic_src'
A.
ohos:basement='$graphic:graphic_src'
Answers
B.
ohos:background_element='$graphic:background
B.
ohos:background_element='$graphic:background
Answers
C.
ohos:background_element='#000000'
C.
ohos:background_element='#000000'
Answers
D.
ohos:background_element='$color:black'
D.
ohos:background_element='$color:black'
Answers
Suggested answer: B, C, D

Which of the following prerequisites are required for developers to access the process of another device or call the methods of another device on one device to achieve multi-device collaboration?

A.
The project contains at least 2 or more modules
A.
The project contains at least 2 or more modules
Answers
B.
Connect to the same WiFi network
B.
Connect to the same WiFi network
Answers
C.
You need to select a real device and have been connected to the PC normally
C.
You need to select a real device and have been connected to the PC normally
Answers
D.
Log in to different HUAWEI IDs
D.
Log in to different HUAWEI IDs
Answers
Suggested answer: A, B, C
Total 705 questions
Go to page: of 71