HarmonyOS Application Developer Fundamentals Certification Exam (95 points answer)

1. 【False and True】 2.5/2.5

Ability is the smallest unit of system scheduling application, and it is a component that can complete an independent function. An application can contain one or more Abilities.

Correct (True)

correct answer

2. 【False and True】 2.5/2.5

All custom components decorated with @Component support onPageShow, onBackPress and onPageHide lifecycle functions.

Error (False)

correct answer

3. 【False and True】 2.5/2.5

Each time the router.pushUrl() method is called, the number of page stacks will be increased by 1 by default, and the maximum number of pages supported by the page stack is 32.

Correct (True)

correct answer

4. 【Judgement】 2.5/2.5

The Video component can support local video path and network path playback. When playing online video, you need to apply for permission ohos.permission.INTERNET.

Correct (True)

correct answer

5. 【False and True】 2.5/2.5

In Column and Row container components, justifyContent is used to set the alignment format of subcomponents in the direction of the main axis, and alignItems is used to set the alignment format of subcomponents in the direction of the cross axis.

Correct (True)

correct answer

6. 【Judgement】 2.5/2.5

The Tabs component can only contain the subcomponent TabsContent, and each tab corresponds to a content view, that is, the TabContet component.

Correct (True)

correct answer

7. 【Judgement】 2.5/2.5

Each custom component has its own lifecycle

Correct (True)

correct answer

8. 【False and True】 2.5/2.5

Preferences store data in the form of Key-Value, where Key can be repeated.

Error (False)

correct answer

9. 【False and True】 2.5/2.5

When using the http module to initiate a network request, you must use on('headersReceive') to subscribe to the request header, and the request will be successful.

Error (False)

correct answer

10. 【Judgement】 2.5/2.5

The web component can use the zoom(factor: number) method for all web pages to zoom.

Error (False)

correct answer

11. [True or False Questions] 2.5/2.5

The @CustomDialog decorator is used to decorate custom pop-up window components, so that the pop-up window can dynamically set the content and style.

Correct (True)

correct answer

12. 【Single Choice】 2.5/2.5

There are two Text components in the Row component. If you use the justifyContent alignment method, which of the following properties can achieve left and right alignment:

A. FlexAlign.StartB. FlexAlign.SpaceEvenlyC. FlexAlign.EndD. FlexAlign.SpaceBetween

correct answer D

13. 【Single Choice】 2.5/2.5

Which of the following modules needs to be imported to initiate a network data request?

A. import http from '@ohos.net.http'B. import http from '@ohos.net.https'C. import request from '@ohos.request'D. import request from '@ohos.net.request'

correct answer A

14. 【Single Choice】 2.5/2.5

Which of the following event methods can get the offset of List sliding

A. onScrollB. onScrollIndexC. onReachStartD. onReachEnd

correct answer A

15. 【Single Choice】 2.5/2.5

Which of the following permissions is required to load network images using the Image component?

A. ohos.permission.READ_MEDIAB. ohos.permission.INTERNETC. ohos.permission.GET_NETWORK_INFOD. ohos.permission.DISTRIBUTED_DATASYNC

correct answer B

16. 【Single Choice】 2.5/2.5

Regarding the Button component, which of the following styles is a capsule button:

A. ButtonType.CapsuleB. ButtonType.NormalC. ButtonType.CircleD. None of the above

correct answer A

17. 【Single Choice】 2.5/2.5

Which of the following methods can jump to a new page and destroy the current page.

A. router.pushUrl()B. router.replaceUrl()C. router.back()D. router.clear()

correct answer B

18. 【Single Choice】 2.5/2.5

In which of the following files can the path configuration information of the page be set?

A. main_pages.jsonB. module.json5C. app.json5D. package.json

correct answer A

19. 【Single Choice】 2.5/2.5

The maximum length of the preference key is limited to size () bytes?

A. 60B. 70C. 80D. 90

correct answer C

20. 【Single Choice】 2.5/2.5

For example, if you want to implement an advertisement pop-up window, which contains information such as pictures and text, you can use the following pop-up window to achieve it

A. AlertDialogB. @CustomDialogC. TextPickerDialogD. TimePickerDialog

correct answer B

21. 【Single Choice】 0/2.5

Which of the following combinations cannot achieve two-way data synchronization between parent and child components for child components.

A. @State and @LinkB. @Provide and @ConsumeC. @Observed and @ObjectLinkD. @State and @Prop

wrong answer D

22. 【Single Choice】 2.5/2.5

About Resource is a resource reference type description error is:

A. Resource is a resource reference type, used to set the value of component properties. B. Reference application resources in the form of "$r('app.type.name')". app represents resources defined in the resources directory within the application, and type represents the resource type (or resource storage location). C. Resource supports all data types. D. The system can load appropriate Resource resources according to the current configuration. For example, developers can present different layout effects according to screen size, or provide different strings according to language settings.

correct answer C

23. 【Single Choice】 2.5/2.5

What data types are supported for storage of preferences values?

A. Number type B. Character type C. Boolean type D. Number type, character type, Boolean type and the array types of these three types.

correct answer D

24. 【Single Choice】 2.5/2.5

Which of the following components cannot contain child components:

A. RowB. ButtonC. TextD. LoadingProgress

correct answer D

25. 【Single Choice】 2.5/2.5

Regarding the position setting of the Tabs component tab, the error described below is

A. When the barPosition is Start (the default value) and the vertical property is false (the default value), the tab is at the top of the container. B. When the barPosition is Start (the default value) and the vertical property is true, the tab is located on the left side of the container. C. When the barPosition is End and the vertical property is false (the default value), the tab is located at the bottom of the container. D. When the barPosition is End and the vertical property is true, the tab is at the bottom of the container.

correct answer D

26. 【Single Choice】 2.5/2.5

Regarding the callback event of the Video component, the following statement is wrong:

A. The onStart event is triggered when the video is playing, and the video duration can be obtained here. B. onFinish This event is triggered when the video playback ends. C. onPrepared This event is triggered when the video preparation is completed. D. onUpdate This event is triggered when the playback progress changes, the unit is s, and the update interval is 250ms.

correct answer A

27. 【Single Choice】 2.5/2.5

Regarding the @State state data characteristics, the following descriptions are wrong:

A. The variable decorated with @State is the state data inside the component. When the state data is modified, the build method of the component will be called to refresh the UI. B. Properties marked @State are private variables and can only be accessed within the component. C. The @State variable does not need to be given an initial value. D. The @Link decorated variable of the child component can establish two-way data binding with the @State variable of the parent component.

correct answer C

28. 【Single Choice】 2.5/2.5

Which kind of decorator can be used as a page entry component?

A. @ComponentB. @EntryC. @PreviewD. @Builder

correct answer B

29. 【Single Choice】 2.5/2.5

Which of the following modules does page routing need to import?

A. import prompt from '@ohos.prompt'B. import router from '@ohos.router'C. import Notification from '@ohos.notification'D. import window from '@ohos.window'

correct answer B

30. 【Single Choice】 2.5/2.5

Regarding Web Components, what is wrong is described below:

A. The WebController controller can control various behaviors of Web components, such as forward, backward, runJavaScript, etc. B. Web components support the setting of various properties such as fileAccess and javaScriptAccess. For example, .javaScriptAccess(true) means that JavaScript scripts are allowed to be executed. C. The web component supports various events such as onConfirm, onConsole, etc. For example, the onConfirm callback is triggered when the web page calls confirm() for an alarm. D. Both online and offline web pages need to be added with ohos.permission.INTERNET permission when using Web components.

correct answer D

31. 【Single Choice】 2.5/2.5

Regarding the container components Row and Column, the following statements are wrong:

A. The main axis of the Column container is the vertical direction, and the cross axis is the horizontal direction; the main axis of the Row container is the horizontal direction, and the cross axis is the vertical direction. B. The main axis and the cross axis are always perpendicular to each other, and the directions of the Row and Column main axes are different. C. The alignment of the subcomponents of the Column in the direction of the main axis is set using the justifyContent property, and its parameter type is FlexAlign. D. The alignment of Row's subcomponents in the direction of the cross axis is set using the alignItems property, and its parameter type is HorizontalAlign.

correct answer D

32. 【Single Choice】 2.5/2.5

Regarding the startup mode of UIAbility, the following statements are wrong:

A. UIAbility supports three launch modes: single instance, standard mode, and specified instance, which are configured through launchType in module.json. B. singleton is a single instance mode. There is only one instance in the system. When startAbility, if it already exists, the only instance in the system will be reused. C. standard is the standard mode, every startAbility will start a new instance, the system defaults to the standard mode. D. specified is the specified instance mode, and the internal business of Ability decides whether to create multiple instances at runtime.

correct answer C

33. 【Multiple choice】 0/2.5

Which of the following container components are scrollable

A. ScrollB. ListC. RowD. GridE. Column

wrong answer ABD

34. 【Multiple choice】 2.5/2.5

Which of the following are the life cycle callback functions of Ability?

A. onCreateB. onDestroyC. onPageShowD. onPageHideE. onForegroundF. onBackground

Answer correctly ABEF

35. 【Multiple choice】 2.5/2.5

Which of the following information is contained in module.json5 under entry:

A. Application package name and version number information B. Ability configuration information C. Device type information D. Application permission application list

Answer correctlyBCD

36. 【Multiple choice】 2.5/2.5

Which of the following is correct about the basic composition of the ArkTS declarative development paradigm

A. Decorator: Used to decorate classes, structures, methods, and variables to give them special meanings. For example, @Entry indicates that this is an entry component. B. Custom components: Reusable UI units that can be combined with other components. C. UI Description: A declarative approach to describe the structure of the UI, such as code blocks in the build() method. D. Built-in components: The default built-in basic components and layout components in ArkTS can be called directly by developers, such as Column, Text, Divider, Button, etc. E. Property method: used to configure component properties, uniformly set through property methods, such as fontSize(), width(), height(), color(), etc. F. Event method: used to add the response logic of the component to the event, and uniformly set it through the event method, such as onClick() following the Button.

Answer correctly ABCDEF

37. 【Multiple choice】 2.5/2.5

Which of the following component hierarchies are correct.

A. Text>SpanB. Button>Column>ImageC. Button>Image>TextD. Image>Text>SpanE. Column>Row>Button

Answer correctly ABE

38. 【Multiple choice】 2.5/2.5

The correct description of the ForEach(arr, itemGenerator, index) component is:

A. ForEach can loop through the logic code, such as console.info('hello')B. The first parameter must be an array, which provides a data source for loop rendering. C. The second parameter generates a lambda function for subcomponents, generating subcomponents for each array item in the data source. D. The third parameter is an anonymous function, which is used to generate a unique and stable key value for a given array item.

Answer correctlyBCD

39. 【Multiple choice】 2.5/2.5

Which of the following properties can be used for components containing text elements, such as Text, Button, TextInput, etc.:

A. fontColorB. fontSizeC. fontStyleD. fontWeightE. fontFamily

Answer correctly ABCDE

40. 【Multiple choice】 2.5/2.5

Regarding the Tabs component and the TabContent component, the following description is correct

A. The TabContent component does not support setting the general width property, and its width is equal to the barWidth property of the Tabs component. B. The TabContent component does not support setting the general height property, and its height is determined by the height of the parent component Tabs and the height of the TabBar component. C. TabsController is used to control Tabs components to switch between tabs. It does not support one TabsController to control multiple Tabs components. D. The tabBar property of the TabContent component supports components generated using the @Builder constructor.

Answer correctly ABCD

Guess you like

Origin blog.csdn.net/feng8403000/article/details/132448233