Android Face Test Summary

Source: Internet
Author: User
Tags sqlite database

1.Android four components and role???

           Activity:activity is the Android program and user implementation of the window, is the most important in Android, it needs to preserve the state of the various facets, do a lot of persistent things.                    Service: Run with background services to activity, define acceptable intent to provide synchronous and asynchronous interfaces.               Content Provider:               Broadcast Receiver:

The V layout commonly used in 2.Android???

       Framelayout: Frame layout                 linearlayout: Linear layout                 absoluelayout: Absolute layout                relativelayout: Relative layout                

What are the types of animations in 3.Android??? What are their characteristics and differences???

       Two kinds, one is tween animation, another is frame animation.                tween animations can be implemented in such a way that the view components move, zoom in, zoom out, and create changes in transparency.               frame animations, which play a set of pictures in a certain order (such as a GIF).

4.Android in the ListView optimization scheme???

            If it is a custom adapter, consider whether the pass-in parameter, Contenview, is null in the GetView method, and is used directly if it is not null, minimizing the creation of the view.                     Set Tag (Settag ()) to Contentview and pass in the Viewholaer object, which is used to cache the data to be displayed, and can achieve the asynchronous loading of the image data.                   

5. the difference between ArrayList and LinkedList and the applicable scene???

    Arraylist: The            Advantage: Arraylist is the realization of the data structure based on the dynamic array, because the address is continuous, once the data is stored well, the query operation efficiency will be higher (in memory is attached).            disadvantage: Because the address is continuous, ArrayList to move the data, so the insertion and deletion operation is less efficient.    LinkedList:            Advantages: LinkedList is based on the data structure of the linked list, the address is arbitrary, so in the open memory space when there is no need to wait for a continuous address, for new and delete operations Add and remove,linedlist more dominant. The LinkedList applies to scenes that you want to work with or insert at a specified location.            disadvantage: Because the linkedlist to move the pointer, the query operation performance is relatively low.    Scenario Analysis: When the data needs to be accessed in the case of ArrayList, when the need to increase the number of data to delete the changes to use LinkedList.

The 6.View drawing process???

    The drawing process for view: Onmeasure ()-->onlayout ()--and OnDraw ()    The main work of each step:    onmeasure ():            measure the view size. The measure method is called recursively from the top-level parent view to the child view, and the measure method callbacks the Onmeasure. OnLayout ():            determines the view location for page layout. The process of calling the View.layout method recursively from the top-level parent view to the child view, that is, the parent view puts the child view in the appropriate position based on the layout size and layout parameters that were obtained from the previous step measure the child view.    OnDraw ():            draw View: Viewroot Create a Canvas object, and then call OnDraw (). Six steps: ①, drawing the background of the view, ②, saving the canvas layer, ③, drawing the View, ④, drawing the view sub-view, if not, ⑤, restore layer, ⑥, draw scroll bar. 

7.activity life cycle???

    activity life cycle methods are mainly OnCreate (), OnStart (), Onresume (), OnPause (), OnStop (), OnDestroy (), and Onrestart () methods.    initiates a Activity that executes the OnCreate (), OnStart (), Onresume () methods, respectively.    Open B activity from activity a onPause (), b onCreate (), b OnStart (), b onresume (), a onStop () method respectively.    Close B Activity, performing b onPause (), a onrestart (), a onStart (), a onresume (), b onStop (), b OnDestroy () methods, respectively.    Toggle a Activity, and the manifest file does not set the Android:configchanges property, first destroy OnPause (), OnStop (), OnDestroy () and then re-create OnCreate (), OnStart ( ), Onresume () method, setting Orientation| screensize (must appear at the same time) property values, do not walk the life cycle method, will only execute the onconfigurationchanged () method.    switching between the activity can be seen OnPause (), OnStop () The two methods are more special, when switching OnPause () method do not add too much time-consuming operation will affect the experience. 

8.android of data storage???

            use sharedpreferences to store data; it is a mechanism provided by Android to store some simple configuration information in an XML format that stores data in a device. Can only be used within the same package and cannot be used between different packages. File            store data, file storage is a more common method , the method of reading/writing files in Android, and the implementation of i/O in Javaprogram is exactly the same, provides openfileinput () and the Openfileoutput () method to read the files on the device.            SQLite database stores data; SQLite is a standard database with Android, it supports SQL statements, it is a lightweight embedded database.            use ContentProvider to store data, primarily for data exchange between applications, enabling other applications to save or read the various data types of this content provider.            networked storage of data, uploading (storing) and downloading (acquiring) the data we store in cyberspace through the storage space available on the network. 

9.Activity boot mode???

            Standard: Normal mode, also the system default boot mode. If activity A initiates activity B, activity B runs on the task stack where activity A is located. And each time an Activity is started, a new instance is recreated, regardless of whether the instance already exists in the task.             singletop: Stack top multiplexing mode. If activity A initiates activity B, it will determine if the top of the task stack on which a is located is an instance of B. If it is, instead of creating a new activity B instance, it directly references the top instance of the stack, and the Onnewintent method is called back, and the current request information is obtained through the parameters of the method, and if not, a new activity B instance is created.            singletask: In-stack multiplexing mode. The first time the activity is started, a new task is created and an instance of the activity is initialized and placed at the bottom of the new task. But it needs to meet certain conditions. That is, you need to set the Taskaffinity property.            singleinstance: Single-instance mode. This is an enhanced version of the Singletask mode, which, in addition to having all the features of the Singletask mode, has a unique feature that the activity of this pattern can only be isolated on a single task stack, not with other activity on the same task stack.

10. Broadcast registration???

            First write a class to inherit Broadcastreceiver            first: Declare in the manifest file, add the second: Register with code such as:    <receive android:name = " Broadcastreceiverdemo ">        <intent-filter>            <action android:name=" Android.provider.Telephony.SMS_RECEIVED ">        </intent-filter>    </receiver>             The second type: Use the code to register    such as:new    intentfilter ("Android.provider.Telephony.SMS_RECEIVED");     New broadcastreceiver ();    Registerreceiver (receiver, filter);            The difference between the two types of registrations is that the    first is a resident broadcast, which means that when the application is closed, the program is automatically run by the system call if there is a message broadcast.    

Android Face Test Summary

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.