Guangzhou Cool Dog Computer Technology online assessment Questions Android post

Source: Internet
Author: User

One Choose 15-way question
1

Whether the collection class is thread safe
Vector Thread Safety
ArrayList Non-thread safe
LinkedList Non-thread safe
Hashtable Thread Safety
HashMap Non-thread safe
TreeMap Non-thread safe

2

Tween Animation
Alpha Gradient
Scale size
Translate mobile
Rotate rotation

3

What cycle of activity gets focus

OnCreate activity is being created by doing some initialization work loading interface layout initialization data etc.

Onrestart Activity Restart

OnStart activity is starting already visible but cannot interact with user

Onresume activity visible at the front desk and start activities

OnPause activity is stopping

OnStop activity is about to stop and can do a bit of heavy-duty recycling

OnDestroy activity is about to be destroyed for recycling and eventual resource release

4

Customizing the View procedure

Onmeasure (), OnLayout (), OnDraw ()
Measuring layout drawing

5

ANR Time

Input Event 5 sec
Broadcastreceiver onreceive () 10 sec
Service each period 20 seconds

6

Android:layout_weight Use Range

LinearLayout

Two 4 simple answer question
1

1 handler mechanism
when the asynchronous message processing thread starts, it enters an infinite loop body once each loop takes a message out of its internal message Queue
Column and then callbacks the corresponding message handler function to complete a message and then resumes looping
If Message Queuing is empty thread blocking wait
Code Execution Flow
1, first looper.prepare () saves a looper instance in this thread, and then holds a
MessageQueue object in that instance; because Looper.prepare () Can only be called once in a thread, so
MessageQueue only exists in one thread.
2, Looper.loop () causes the current thread to enter an infinite loop, MessageQueue to read from the instance of the message
, and then callback the Msg.target.dispatchMessage (msg) method. The constructor of
3, handler, first obtains the Looper instance that is saved in the current thread and, in turn, relates to MessageQueue in the Looper real
case. The SendMessage method of
4, handler, assigns the target of MSG to handler itself, and then joins
MessageQueue.
5, when constructing an handler instance, we override the Handlemessage method, which is the method that the
Msg.target.dispatchMessage (msg) eventually calls.

The message is an intra-thread pass-through that can carry a small amount of information inside
Exchanging data between
The What field of the Message, in addition to using the Arg1 and Arg2 fields to carry some integral types
Data
Using the obj field to carry a single object
The Handler processor is primarily used to send and process messages for sending messages that are typically used by Handler
SendMessage () method,
And after a series of processing, the message will eventually pass to Handler's
In the Handlemessage () method
MessageQueue
Message Queuing holds all messages sent through handler. This part of the message will always be in the news team.
column, waiting to be processed.
There will only be one MessageQueue object in each thread
Looper
Each thread of the MessageQueue steward, after calling the Looper loop () method, will
into an infinite loop, and then whenever a message is found in the MessageQueue, it
Take it
and passed to the handler Handlemessage () method. There will only be one in each thread
Looper Object

2

Binder mechanism
Binder is an IPC inter-process communication structure in an Android system.
Binder's entire design is the C/s structure, the client process through the server to obtain the agent process, and through
Data is read and written to this proxy interface method to complete interprocess communication.
I think there are 2 reasons why Android chose Binder.
1 is secure, each process will be assigned the UID and PID by the Android system, unlike the traditional data added
UID, which allows malicious processes to communicate directly with other processes, and improves the security of inter-process communication

2 is efficient, such as the socket of the IPC every data copy needs 2 times, and binder as long as 1 times, in the hand
This resource-intensive situation is important.

3

Definition and common causes of memory leaks
Some objects in the process (garbage objects) have no use value, but they can directly or indirectly lead to
GC roots is used to prevent GC collection. Useless objects occupy a memory space, making it possible to actually use the memory
Smaller, the image of the statement is a memory leak.
1 Static variables cause
2 single-case mode causes
3 Property Animation causes

4

ListView optimization to solve picture confusion
1 Convertview use, the main optimization load layout problems
2 internal class Viewholder use the main optimization GetView method for each callback with the Findviewbyid () method
To get the code for the control once.
3 use of the image loading framework

Guangzhou Cool Dog Computer Technology online assessment Questions Android post

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.