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

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

Question list
Search
Search

List of questions

Search

Related questions











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.

A.
NFC basic query
A.
NFC basic query
Answers
B.
Access to the security element
B.
Access to the security element
Answers
C.
card emulation
C.
card emulation
Answers
D.
NFC message notification
D.
NFC message notification
Answers
Suggested answer: A

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)?

A.
'comment': 'xxX'
A.
'comment': 'xxX'
Answers
B.
#XXX
B.
#XXX
Answers
C.
/+X+/ or /XXX
C.
/+X+/ or /XXX
Answers
D.
xXxX
D.
xXxX
Answers
Suggested answer: A

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?

A.
Distributed file services
A.
Distributed file services
Answers
B.
Distributed data services
B.
Distributed data services
Answers
C.
Data search services
C.
Data search services
Answers
D.
Data storage management
D.
Data storage management
Answers
Suggested answer: B

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()));

}

A.
When you click the button again, the ability crashes
A.
When you click the button again, the ability crashes
Answers
B.
button button does not show up on the layout
B.
button button does not show up on the layout
Answers
C.
Clicking the button does not respond
C.
Clicking the button does not respond
Answers
D.
Click the button button to jump to a new page
D.
Click the button button to jump to a new page
Answers
Suggested answer: B

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; } } Both DOWN and UP events can be handled normally
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; } } Both DOWN and UP events can be handled normally
Answers
B.
Neither event can be processed
B.
Neither event can be processed
Answers
C.
can only handle DOWN events
C.
can only handle DOWN events
Answers
D.
Only UP events can be processed
D.
Only UP events can be processed
Answers
Suggested answer: A

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);

}

A.
Gives subscribers permissions
A.
Gives subscribers permissions
Answers
B.
implements asynchronous operations, which solves the problem that time-consuming operations cannot be performed on onReceiveEvent
B.
implements asynchronous operations, which solves the problem that time-consuming operations cannot be performed on onReceiveEvent
Answers
C.
sets the priority of ordered public events
C.
sets the priority of ordered public events
Answers
D.
The publisher has the permission to publish sticky public events
D.
The publisher has the permission to publish sticky public events
Answers
Suggested answer: B

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

A.
'module': { 'reqPermissions': [ { 'name':'com.myability.permission.MYPERMISSION ' 'grantMode':'system_grant', 'availableScope': ['signatures'] } }
A.
'module': { 'reqPermissions': [ { 'name':'com.myability.permission.MYPERMISSION ' 'grantMode':'system_grant', 'availableScope': ['signatures'] } }
Answers
B.
'module': { 'defPermissions': [ 'name':'com.myability.permission.INTERNET' 'grantMode':'user_grant' 'availableScope': ['signatures'] } }
B.
'module': { 'defPermissions': [ 'name':'com.myability.permission.INTERNET' 'grantMode':'user_grant' 'availableScope': ['signatures'] } }
Answers
C.
'module': { 'defPermissions': [ { 'name':'com.myability.permission.INTERNET' 'grantMode':'system_grant' 'availableScope': ['signatures'] } }
C.
'module': { 'defPermissions': [ { 'name':'com.myability.permission.INTERNET' 'grantMode':'system_grant' 'availableScope': ['signatures'] } }
Answers
D.
'module': { 'defPermissions': [ { 'name':'com.myability.permission.MYPERMISSION', 'grantMode':'system_grant' 'availableScope': ['signatures'] } }
D.
'module': { 'defPermissions': [ { 'name':'com.myability.permission.MYPERMISSION', 'grantMode':'system_grant' 'availableScope': ['signatures'] } }
Answers
Suggested answer: D

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?

A.
onStart()
A.
onStart()
Answers
B.
onActive()
B.
onActive()
Answers
C.
onInactive()
C.
onInactive()
Answers
D.
onStop()
D.
onStop()
Answers
Suggested answer: A

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

A.
terminateAbility()
A.
terminateAbility()
Answers
B.
stopAbility()
B.
stopAbility()
Answers
C.
connectAbility()
C.
connectAbility()
Answers
D.
startAbility()
D.
startAbility()
Answers
Suggested answer: A

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

A.
INITIAL
A.
INITIAL
Answers
B.
INACTIVE
B.
INACTIVE
Answers
C.
ACTIVE
C.
ACTIVE
Answers
D.
BACKGROUND
D.
BACKGROUND
Answers
Suggested answer: B
Total 705 questions
Go to page: of 71