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. Describe the lifecycle of an Activity.

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 in form layout; AbsLayout in absolute layout (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]

 

1. What is ANR and how 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. What types of Android animations are available? 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. Understanding of Intent, Activity, broadcast, Service, etc.

 

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

Application not response.

5. Differences between implicit and explicit Intent

·Explicit intentSpecify the target component by name (This component name field, as mentioned earlier, has a value set ). 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.