Android pen interview questions

Source: Internet
Author: User

Android interview questions

1. Which of the following statements about memory reclaim are correct? (B)
A. the programmer must create a thread to release the memory.
B. The memory reclaim program is responsible for releasing useless memory.
C. The memory reclaim program allows programmers to directly release the memory.
D. The memory reclaim program can release memory objects at the specified time.

2. The following exception is a runtime exception (ABCD) (Multiple choices)
A. arithmeticexception
B. illegalargumentexception
C. nullpointerexception
D. bufferunderflowexception

3. Math. Round (11.5) equals to the number ().
Math. Round (-11.5) equals to (c ).
A, 11,-11 B, 11,-12 C, 12,-11 D, 12,-12

4. The output result of the following program segments is: (B)

[Java]
View plaincopy
  1. <Span style = "font-size: 18px;"> void complicatedexpression_r (){
  2. Int x = 20, y = 30;
  3. Boolean B;
  4. B = x> 50 & Y> 60 | x> 50 & Y <-60 | x <-50 & Y> 60 | x <-50 && Y <-60;
  5. System. Out. println (B );
  6. } </Span>

A, true B, false C, 1 d, 011. Activity

5. Save some resource and status operations, preferably in which function of the lifecycle (d)
A, onpause () B, oncreate () C, onresume () d, onstart ()

6. Which of the following data types can be passed (ABCD) When intent transmits data (Multiple choices)
A, serializable B, charsequencec, parcelabled, Bundle

7. Which of the following functions of Android are intent (c)
A. implement data sharing between applications
B. It is a long life cycle. programs without a user interface can keep the applications running in the background without switching the page.
C. You can switch between interfaces, including actions and action data, and connect the four components.
D. process the integrity of an application

8. Which of the following are advantages of parsing XML files by Sax? (B)
A. The entire document tree is stored in the memory, which is easy to operate and supports deletion, modification, and rescheduling.
B. The entire document does not need to be transferred in advance, which consumes less resources.
C. The entire file is transferred to the memory, which wastes time and space.
D. The data does not reside in the memory for a long time and is not persistent. After the event, if the data is not saved, the data will disappear.

9. Which of the following methods is correct for custom Styles? ()

A,
<Resources>
<Style name = "mystyle">
<Itemname = "Android: layout_width"> fill_parent </item>
</Style>
</Resources>
B,
<Style name = "mystyle">
<Itemname = "Android: layout_width"> fill_parent </item>
</Style>
C,
<Resources>
<Itemname = "Android: layout_width"> fill_parent </item>
</Resources>
D,
<Resources>
<Stylename = "Android: layout_width"> fill_parent </style>
</Resources>

 

10. The methods that may need to be rewritten when using menu in Android are (AC ). (Multiple options)

A. oncreateoptionsmenu ()

B. oncreatemenu ()

C. onoptionsitemselected ()

D. onitemselected ()

 

11. Run the following T-SQL statement in SQL servermanagement studio with the output value (c ).

Select @ identity

A. It may be 0.1

B. It may be 3

C. Impossible-100

D. It must be 0.

 

12. Run the following T-SQL statement in SQL server2005, assuming that the sales table has multiple rows of data, the result after the query is (d ).

Begin transaction
Update sales set qty = 30 Where qty <30
Begin transaction B
Update sales set qty = 40 whereqty <40
Update sales set qty = 50 whereqty <50
Update sales set qty = 60 whereqty <60
Commit transaction B
Commit transaction

A. the minimum value of the qty column in the sales table is greater than or equal to 30.

B. the minimum value of the qty column in the sales table is greater than or equal to 40.

C. The data in the qty column in the sales table is all 50

D. the minimum value of the qty column in the sales table is greater than or equal to 60.

13. When sqliteopenhelper is used in Android, a database can be generated and the database version can be managed by (AB)

A. getwriteabledatabase ()

B. getreadabledatabase ()

C. getdatabase ()

D. getabledatabase ()

14. Which of the following statements about the service life cycle oncreate () and onstart () in Android is true (AD) (multiple choice questions)

A. The oncreate () and onstart () methods are called successively at the first startup.

B. When it is started for the first time, only the oncreate () method is called.

C. If the service has been started, the oncreate () and onstart () methods will be called successively.

D. If the service has been started, only the onstart () method is executed, not the oncreate () method.

 

15. Which of the following is the glsurfaceview feature (ABC) (multiple choice)

A. Manage a surface. This surface is a special memory that can be directly typesented to the android view.

B. Manage An EGL display, which enables OpenGL to render the content to the above surface.

C. Let the Renderer operate in an independent thread and separate it from the UI thread.

D. image data can be obtained directly from hardware interfaces such as memory or DMA.

16. The following is a correct method for registering broadcastreceiver in the androidmanifest. xml file ()

A,

<Cycler Android: Name = "newbroad">

<Intent-filter>

<Action Android: Name = "android. provider. Action. newbroad"/>

<Action>

</Intent-filter>

</Cycler>

B,

<Cycler Android: Name = "newbroad">

<Intent-filter>

Android: Name = "android. provider. Action. newbroad"/>

</Intent-filter>

</Cycler>

C,

<Cycler Android: Name = "newbroad">

<Action Android: Name = "android. provider. Action. newbroad"/>

<Action> </policer>

D,

<Intent-filter>

<Cycler Android: Name = "newbroad">

<Action> Android: Name = "android. provider. Action. newbroad"/>

<Action>

</Cycler>

</Intent-filter>

17. Which of the following statements about the contenvalues class is true? ()
A. He is similar to hashtable and is also responsible for storing some name-value pairs, but
The name is of the string type, and the value is of the basic type.
B. He is similar to hashtable and is also responsible for storing some name-value pairs, but
The name is of any type, and the value is of the basic type.
C. He is similar to hashtable and is also responsible for storing some name-value pairs, but
Name, which can be null, and the values are of the string type.
D. He is similar to hashtable and is also responsible for storing some name-value pairs, but among the name-value pairs he stores
Is of the string type, and the value is of the string type.

18. We all know that hanlder is a bridge between threads and activities. If the thread is improperly processed, the slower your machine will become, the thread destruction method will be ()
A. ondestroy ()
B. onclear ()
C. onfinish ()
D. onstop ()

19. The following error method for exiting activity is (c)
A. Finish ()
B. Throwing an exception and force exit
C, system. Exit ()
D. onstop ()

20. Which of the following Android animation categories are (AB) (multiple)
A, Tween B, frame C, draw D, and animation

21. Which of the following statements about the androiddvm process and the Linux Process is true for the application process? (d)
A. DVM refers to the Virtual Machine of dalivk. every android application runs in its own process and does not necessarily have an independent Dalvik Virtual Machine instance. every DVM is a process in Linux, so it can be considered the same concept.
B. DVM refers to the Virtual Machine of dalivk. every android application runs in its own process and does not necessarily have an independent Dalvik Virtual Machine instance. every DVM is not necessarily a process in Linux, so it is not a concept.
C. DVM refers to the Virtual Machine of dalivk. every android application runs in its own process and has an independent Dalvik Virtual Machine instance. every DVM is not necessarily a process in Linux, so it is not a concept.
D. DVM refers to the Virtual Machine of dalivk. every android application runs in its own process and has an independent Dalvik Virtual Machine instance. every DVM is a process in Linux, so it can be considered the same concept.

22. What is the role of the assets directory under the android Project (B)
A. Place the image resources to be applied.
B. Mainly store multimedia and other data files
C. Place string, color, array, and other constant data
D. place some layout files corresponding to the UI, which are XML files.

23. Which of the following statements about the Res/raw directory is true? ()
A. The files here are not converted to binary format after they are stored on the device.
B. The files are stored on the device and converted to binary format.
C. The files are finally stored in the specified package in binary format.
D. The files here will not be stored in the specified package in binary format.

24. Which of the following statements about Android ndk is true? (ABCD)
A. ndk is a collection of tools
B. ndk provides a stable and functional API header file statement.
C. Finally, the development method of "Java + C" has become officially supported.
D. ndk will be the beginning of C development on the Android platform.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.