[Android interview] highlights of Android interview questions (updated in succession)

Source: Internet
Author: User
Tags xml parser java se

 

I will summarize some common android interview basic questions to see how many questions can you make?


 

 1. What are several intent startup methods? Do you understand each meaning?



 

 

Here, android123 reminds you that some intent tags include flag_activity_brought_to_front, flag_activity_clear_top, struct, struct, flag_activity_multiple_task, and flag_activity_new_task. For every meaning, you can read the SDK documentation and run it down so that your memory will be more profound.

 

 

2. What are the startup modes of activity and task? What is each meaning?

 

 

For. the Android: launchmode definition in XML mainly includes standard, singletop, singletask, and singleinstance. You also need to know about Android: taskaffinity. As mentioned in previous articles, however, many developers are still not very clear, and we will continue to summarize these basic issues in the future.

 

For more information about the Startup Mode of activity, see: http://blog.csdn.net/feng88724/archive/2011/05/11/6412638.aspx

 

3. What are the methods for transmitting binary data through intent?

 

 

1). Use the serializable interface to implement serialization, which is a common method in Java.

2) Implement the parcelable interface. Here, the android partial classification, such as the bitmap class, has been implemented, and parcelable is also very common in the android aidl for data exchange.

 

 

4. Can you tell me the entry point of the Android app?

 

 

The real Android portal is the main of application. You can see the inclusion relationship of androidmanifest. xml. No activity is allowed, but application is required.

 

 

 

 5. What XML parser does Android have?

 

 

Here xmlpull, sax, and Dom are believed to have been well developed for web development.

 

 

 

6. Does SQLite support transactions? How can I improve performance by adding or deleting a file?

 

 

As a lightweight database, SQLite is smaller than MySQL, But it supports SQL statement queries. To improve performance, you can consider using the original optimized SQL query statement.

 

 

 

7. Are you familiar with Android service, binder, and aidl?

 

 

As an important background service for Android, every android developer should master it. This is the biggest difference from Java SE. For specific examples, you can view the source code music of the android music player. in git, I will not go into details here.

 

 

 8. Which Android phone have you used? What are the advantages and disadvantages of iPhone or Symbian?

 

 

Taking this as an interview question is also an example, we can get a general idea of how much we know about Android and how much we know about mobile development.

 

 

[Supplement]

 

1.Please describeActivity.


Create oncreate-start onstart-Recover onresume-Pause onpause-end onend-destroy ondestroy

 


2. If the background activity is recycled by the system for some reason, How can I save the current status before being recycled by the system?


Save the data in the pause onpause status.

 

3. Set an activity as a window style.


Set theme.

 

 

4. How to exit the activity? How can I safely exit the application that has called multiple activities?


5. Introduce the five la s commonly used in Android.


Linear layout: linearlayout; relativelayout

Tablelayout,
Absolute layout abslayout (obsolete)

Frame layout framelayout

 


6. Describe how to store Android data.


Preference, file, database SQLite, Network Storage

 

 

7. introduce how contentprovider achieves data sharing.



8. How to enable and disable the service.


Start:Context.startService()AndContext.bindService().

Close:Context.stopService().

           Service.stopSelf()OrService.stopSelfResult()

 


9. There are several ways to register broadcast. What are the advantages and disadvantages of these methods? Let's talk about the intention of introducing the broadcast mechanism to Android.

 

10. Explain the relationships among message, handler, message queue, and logoff in the single-thread model.

11. What is the full name of aidl? How to work? What types of data can be processed?

12. Please explain the differences between the permissions for running Android programs and those for file systems. (Edited by sodino)

13. multiple browsers are installed on the system. Can I specify a browser to access a specified page? Describe the reason.

14. A one-dimensional integer array int [] data stores the pixel value of an image with the width and height. Write an algorithm to adjust the transparency of all the white (0 xffffffff) pixels in the image to 50%.

15. How do you evaluate the Android system? Advantages and disadvantages. (This question already exists)


Advantages: 1. Openness 3. Rich hardware options 5. seamless integration of Google Application Support

 

Disadvantages: 1. Security and Privacy 2. customization by developers, not uniform enough. 4. Fewer users of similar models

 

 

 

 

[Supplement]

 

1What isANRHow to avoid it?


 

Http://blog.csdn.net/Zengyangtech/archive/2010/11/21/6025671.aspx

 


2. What will cause force close? How to avoid it? Can I capture exceptions that cause them?


 


 

3. If Android APIs do not declare that they will throw an exception, it is impossible to throw a runtime exception during runtime. Have you ever encountered this? What problems will this cause? How can this problem be solved?


 

There will be runtime exceptions, and no need to capture exceptions during runtime

 

 

4. Briefly explain activity, intent, intent filter, service, broadcast,Broadcasereceiver


 

This is a common question. Let's take a look at it. I will not talk about it here!

 



5
What are the advantages of intentservice??

 

[Supplement]

1. Differences between Android: paddingleft and Android: layout_marginleft

When the buttons set the preceding two attributes respectively, the results are different.
Android: paddingleft = "30px"
The content (sample) set on the button is 30 pixels away from the border on the left of the button
Android: layout_marginleft = "30px"
The entire button is 30 pixels away from the content set on the left

 

2. AndroidWhat types of animations are there? Description

. Tween animation and frame animation. Tween animation mainly includes transparency, size scaling, rotation, displacement, and other effects.

Frame Animation can be understood as GIF, a frame-by-frame display image. Scroll bars are commonly used.

 

3.PairIntent,ActivityBroadcast,Service.

 

4.Under what circumstances will happenANR?How can this problem be solved? (This problem is repeated)

Application not
Response.

5.Implicit and explicitIntentDifference

·Explicit intentSpecify the target component by name (This component name field component name
Field ). Since the component name is generally not known to other application developers, explicit intent typically is used as an internal message of the application-for example, an activity starts a ancillary service or sister activity.

Implicit intentDo not name the target component (the component name field is blank ). Implicit intent is often used to activate components of other applications.

 

For more information, see the intent description. You can also take a look at the notepad example to help you understand it. I personally feel very important!

 

(The above questions are all good. Check for missing information yourself! Some of the answers have not yet been written. You can answer them if you are free ~ I will fill in your answer)

 

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.