ExamGecko
Home / Huawei / H14-231_V1.0 / List of questions
Ask Question

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

Add to Whishlist

List of questions

Question 131

Report Export Collapse

Before developing the NFC function, a HarmonyOS developer must first confirm whether the device supports the NFC function and whether the NFC is turned on.

NFC basic query
NFC basic query
Access to the security element
Access to the security element
card emulation
card emulation
NFC message notification
NFC message notification
Suggested answer: A
asked 18/09/2024
Ahmed Khalifa
52 questions

Question 132

Report Export Collapse

When a developer is developing a HarmonyOS application, if he needs to annotate information for a certain resource file of different types of elements in the Element directory to facilitate the understanding and use of the resource, which of the following methods can be added (XXX represents the comment text)?

'comment': 'xxX'
'comment': 'xxX'
#XXX
#XXX
/+X+/ or /XXX
/+X+/ or /XXX
xXxX
xXxX
Suggested answer: A
asked 18/09/2024
Talal Elemam
55 questions

Question 133

Report Export Collapse

If a HarmonyOS developer has developed multiple applications and ensured that the data between different applications cannot be accessed through the triplet of account, application, and database, which of the following services can the developer use to achieve this function?

Distributed file services
Distributed file services
Distributed data services
Distributed data services
Data search services
Data search services
Data storage management
Data storage management
Suggested answer: B
asked 18/09/2024
Joseph Varghese
44 questions

Question 134

Report Export Collapse

When the developer jumps to a new page through the button button, the following code is created. If you don't add '' Button button = (Button) findComponentByld(ResourceTable.ld_button) ;' What happens to this line of code?

Public void onStart(Intent intent){

super.onStart(intent);

super.setUlContent

(ResourceTable.Layout_ability_main);

Button button =

(Button)findComponentByld(ResourceTable.ld_button);

button.setClickedListener(listener -> present(new

SecondAbilitySlice(),new Intent()));

}

When you click the button again, the ability crashes
When you click the button again, the ability crashes
button button does not show up on the layout
button button does not show up on the layout
Clicking the button does not respond
Clicking the button does not respond
Click the button button to jump to a new page
Click the button button to jump to a new page
Suggested answer: B
asked 18/09/2024
57 Milecross Lane Jodie
43 questions

Question 135

Report Export Collapse

What events can the next piece of code handle?

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; } } Both DOWN and UP events can be handled normally
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; } } Both DOWN and UP events can be handled normally
Neither event can be processed
Neither event can be processed
can only handle DOWN events
can only handle DOWN events
Only UP events can be processed
Only UP events can be processed
Suggested answer: A
asked 18/09/2024
Khaled Fouad
35 questions

Question 136

Report Export Collapse

When a developer subscribes to a public event, he processes the public event in the onReceiveEvent() callback function and writes the following code.

EventRunner runner = EventRunner.create();

MyEventHandler myHandler = new

MyEventHandler(rurner);

@Override

public void onReceiveEvent(CommonEventData

commonEventData){

final AsyncCommonEventResult

result=goAsyncCommonEvent Runnable task = new

Runnable(){

@override

pub1ic void run {

......

The action to be performed, defined by the developer

result.finishCommonEvent();

}

};

myHandler.postTask(task);

}

Gives subscribers permissions
Gives subscribers permissions
implements asynchronous operations, which solves the problem that time-consuming operations cannot be performed on onReceiveEvent
implements asynchronous operations, which solves the problem that time-consuming operations cannot be performed on onReceiveEvent
sets the priority of ordered public events
sets the priority of ordered public events
The publisher has the permission to publish sticky public events
The publisher has the permission to publish sticky public events
Suggested answer: B
asked 18/09/2024
Rannie Dayapan
46 questions

Question 137

Report Export Collapse

How do I define the permissions correctly when a developer needs to customize the permissions for the Harmony OS third-party application?

'module': { 'reqPermissions': [ { 'name':'com.myability.permission.MYPERMISSION ' 'grantMode':'system_grant', 'availableScope': ['signatures'] } }
'module': { 'reqPermissions': [ { 'name':'com.myability.permission.MYPERMISSION ' 'grantMode':'system_grant', 'availableScope': ['signatures'] } }
'module': { 'defPermissions': [ 'name':'com.myability.permission.INTERNET' 'grantMode':'user_grant' 'availableScope': ['signatures'] } }
'module': { 'defPermissions': [ 'name':'com.myability.permission.INTERNET' 'grantMode':'user_grant' 'availableScope': ['signatures'] } }
'module': { 'defPermissions': [ { 'name':'com.myability.permission.INTERNET' 'grantMode':'system_grant' 'availableScope': ['signatures'] } }
'module': { 'defPermissions': [ { 'name':'com.myability.permission.INTERNET' 'grantMode':'system_grant' 'availableScope': ['signatures'] } }
'module': { 'defPermissions': [ { 'name':'com.myability.permission.MYPERMISSION', 'grantMode':'system_grant' 'availableScope': ['signatures'] } }
'module': { 'defPermissions': [ { 'name':'com.myability.permission.MYPERMISSION', 'grantMode':'system_grant' 'availableScope': ['signatures'] } }
Suggested answer: D
asked 18/09/2024
Marcos Losa Torviso
57 questions

Question 138

Report Export Collapse

In the Page Ability lifecycle of HarmonyOS, when the system creates a Page instance for the first time, which of the following callback methods will be triggered first?

onStart()
onStart()
onActive()
onActive()
onInactive()
onInactive()
onStop()
onStop()
Suggested answer: A
asked 18/09/2024
Salman Hashmi
41 questions

Question 139

Report Export Collapse

If a developer wants to stop the service in a Service, which of the following APIs needs to be called?

terminateAbility()
terminateAbility()
stopAbility()
stopAbility()
connectAbility()
connectAbility()
startAbility()
startAbility()
Suggested answer: A
asked 18/09/2024
Miguel Bakker
35 questions

Question 140

Report Export Collapse

When the Page of Harmony OS executes the onForeground() callback, which of the following states will the Page return to first?

INITIAL
INITIAL
INACTIVE
INACTIVE
ACTIVE
ACTIVE
BACKGROUND
BACKGROUND
Suggested answer: B
asked 18/09/2024
Ellee Chen
46 questions
Total 705 questions
Go to page: of 71
Search