Go Android 50-side Test paper summary (let's see)

Source: Internet
Author: User

1. What is the difference between a method overload and an overlay? (The difference between overload and override)
2. The difference between String and StringBuffer
3, the string "ABCDE" by writing a function not to call a third-party string, implement a string reverse, such as the string "ABCDE" into "EDCBA".
4, the difference between abstract class and interface (the difference between abstraction and interface
5. What is the difference between the implementation class and the collection?
6, the thread has several states, which are the different? (call run () and call Start ()
7. How to Implement Threads
8. The difference between sleep () and wait ()
9, the wait,join,sleep,yield,notify,notifyall,synchronized in the thread, the difference and the contact
10, Final, finally, finanlize () the Difference
11, common design patterns and application scenarios, in two ways to achieve a single case mode, requiring thread safety
12, the common sorting algorithm, the time complexity, realizes the train of thought
13, Android system architecture?
14, Activity life cycle? The life cycle method in which some information about the activity is saved
15. Activity Onsaveinstancestate () and Onrestoreinstancestate ()
16. What are the four components of Android? What are their roles?
17, how to call the broadcast, what are the different ways, their differences?
18. The difference between asset folder and Raw folder in Android
19. Five kinds of storage methods in Android and their application scenarios
20, what is the ANR how to avoid it? (How is the communication between Android threads?)
21, Handler operating mechanism (operating principle) (Handler,looper,messagequeue,message relationship) 8
22. ListView Optimization Strategy
23, the ListView page load Realization idea
24, the ListView picture asynchronous loading Realization Idea
25, intent principle, function, which types of parameters can be passed
26, how to realize the adaptive screen resolution
27. Briefly describe the IPC mechanism in Android
28. How to judge the entrance of Android program?
29, Android which ways to access the network
30, talk about the httpclient communication process
31. What are the differences between the interactive formats of mobile interconnection data? (The difference between JSON and XML
32. What kinds of XML parsing are there? What are the official recommendations for each of the pros and cons?
33, Baidu Map Core class, and the realization of the function
34. What happens when a GC memory leak occurs? How to Solve
35. Optimization of Android Memory
36. How to prevent memory overflow when loading large images
37. Android Cache mechanism
38, how to achieve message push, what are the ways, their advantages and disadvantages, most commonly used which kind?
39. Application of MVC in Android
40, Android custom components implementation ideas
41, the implementation of version update ideas
42. What are the ways to play video?
43, NDK development process? (JNI operating principle
44, how to implement a key to exit
45. Androidmanifest.xml manifest file <Activity> tag attribute android:excludefromrecents= "true" android:screenorientation= " Portrait the Meaning of "android:configchanges=" Orientation|locale "
46. How to set an activity as a window style
47, talk about the UI, padding and margin what is the difference between gravity and layout_gravity difference
48, which component can realize accordion effect, used to implement the class of setting interface, realize drawer effect, hover window?
49. New features of Android SDK 3.0 (Honeycomb) and 4.0 (icecream)
50. How to implement automatic login for Android client


 1.differences between method overloads and overrides? (OverloadAndOverrideThe difference)For: The overloads of the method belong to the compile-time polymorphic,The method name is the same as the parameter list,The return value must be the same or no return value type. Method overrides are run-time polymorphic and subclasses override the parent class method,Subclasses point to parent class reference,Called with a reference to the parent class when the method is called. 2,String AndStringBufferThe difference A: the length of the string is immutable, and the length of the StringBuffer is variable. If you are frequently manipulating the contents of a string, especially if the content is to be modified, use StringBuffer, and if you need a string at the end, use the ToString () method of StringBuffer. Stringbuder is not safe. StringBuffer is safe.3.string "ABCDE"By writing a function that does not allow the invocation of a third-party string, implement a string reverse, such as a string"ABCDEIntoEDCBA"Answer: String src =" ABCDEF ";
String DST = new StringBuffer (src). Reverse (). toString ();4.the difference between an abstract class and an interface (AbstractAndInterface) A: Abstract can modify an abstraction, and a class, with an abstract method, must define the class with an abstract, which is an abstraction class. Interface-Modified classes, the methods are abstract methods, so when defining the interface, you can directly without those modifications, the system will be added by default. The fields inside the interface are public constants, which are the fields that are static final decorated.5.implementation classes and differences of collections?For: CollectionInterface, total parent interface of the collection structure, with two sub-interfacesListAndSetListAn orderly and repeatable interface element.   The implementation classes are:ArrayListArrays are lightweight, run fast, and thread insecure.JDK1.2Query fastVectorArrays are heavyweight, slow, and thread-safe.JDK1.0LinkedListLinked list implementation The implementation of common language stack and queue delete operation fastSetInterface Element unordered non-repeatable implementation classes are:HashSet, the bottom withhashcode ()Algorithm implementation to ensure that elements are unordered and unique, and that custom objects are stored inHashSetTo ensure that the element content does not overlap needs to be overwrittenhashcode ()Andequals ()Method.SortedSet (Not important) Elements are ordered (UnicodeAscending) UniqueTreeSetRequires an orderly element, custom objects need to be implementedcomparableinterface ofCompareTo(object o) methodMap (Interface): AndCollectionInterface Independent,has a sub-interfaceSortedMapCharacteristics: Element isKey-value, KeyOnly,Disordered; valueRepeatable  Implementation class: HashMapLightweight threads that are unsafe,AllowKeyOrvalueForNULL JDK1.2HashTableHeavyweight Thread-safe Not allowedKeyOrvalueForNULL JDK1.0PropertiesIsHashTableSub-class,Both the primary key and the value are stringsSortedMap: (Not important)  Characteristics: KeyOnly,Ordered(UnicodeAscending)  Implementation class: TreeMap6.There are several states of threads,What are the differences??(CallRun ()and callingStart ()The difference) A: 1), new State (new): A newly created thread object. 2), Ready State (Runnable): After the thread object is created, other threads call the object's start () method. The thread of the state is located in a pool of running threads, becomes operational, waits to getCPUThe right to use.  3), running State (Running): The ready state of the thread acquires the CPU and executes the run () method. 4), blocking state (Blocked): Blocking state is a thread that, for some reason, abandons the CPU and temporarily stops running. Until the thread is in a ready state, the opportunity to go to the running state is reached.  There are three types of blocking: (i), waiting for blocking: The running thread executes the wait () method, and the JVM puts the thread into the waiting pool.  (ii), synchronous blocking: When a running thread acquires a synchronization lock on an object, the JVM puts the thread into the lock pool if the synchronization lock is occupied by another thread. (iii), other blocking: The running thread executes the sleep () or join () method, or when an I/O request is made, the JVM will place the thread in a blocked state. When the sleep () state times out, join () waits for the thread to terminate or time out, or the I/O process finishes, the thread is re-entered in a ready state. 5), Dead State (Dead): The thread finishes executing or exits the run () method because of an exception, and the thread ends the life cycle. When callingStartmethod, the thread enters the ready state. WaitCPUFor scheduled execution, there is no real thread executing at this time. When callingRunMethod is the time that has beenCPUPerforms the main task of scheduling the thread.7.How threads are implementedA: There are two ways to implement a thread, one is to inherit the thread class, and the other is to implement the Runnable interface 8.Sleep () AndWait ()The difference A:1.These two methods come from different classes, respectively,SleepFromThreadClass, andwaitFromObject         Class.2.The main thing isSleepMethod does not release the lock, andwaitMethod frees the lock so that other threads can         To use a synchronous control block or method.SleepDo not sell system resources;waitis to enter the thread waiting pool         Wait, assign system resources, other threads can occupyCPU。 So sowaitNo time limit is added,         Because ifwaitThe thread is running out of resources and it is useless to wait for other threads to callNotify/notifyallWakes all threads in the waiting pool before it enters the ready queue for waitingOSDistribution System         Resources.sleep (milliseconds)You can use time to specify that it automatically wakes up, if the time is not         can only callInterrupt ()Forcibly interrupted.3.wait,NotifyAndNotifyallCan only be used in the synchronous control method or the synchronization control block, andSleepCan be used from anywhere4. SleepNeed to catch exceptions,andwaitDon't need9.in the threadwait,Join,Sleep,yield, notify,Notifyall,synchronized, Difference and contact answer:1). Sleep ()method to suspend execution of the currently executing thread for a specified period of time, but does not release"Lock flag"。 It is not recommended.sleep ()Causes the current thread to enter a blocking state that does not execute for a specified period of time.2). Wait ()method to invoke the object in other threads.NotifyOrNotifyallCauses the current thread to wait before the method. The thread will release the one that it occupies."Lock flag"So that other threads have an opportunity to preempt the lock. The waiting thread that wakes the current object lock is usedNotifyOrNotifyallMethod, Waite ()AndNotify ()Must be insynchronizedfunction orsynchronized   BlockTo make a call in the.
    • The yield method pauses the currently executing thread object. Yield () simply brings the current thread back to the executable state, so the execution
    • 3) The yield () thread is likely to be executed immediately after it enters the executable state. Yield () only causes threads with the same priority or higher priority to have an opportunity to execute. 4). The Join method waits for the thread to terminate. Wait for the thread that called the Join method to end, and then continue execution. such as: T.join ();//mainly used to wait for the T thread to run the end, without this sentence, main will be executed, resulting in unpredictable results. The difference between final, finally, Finanlize () a : final? Used to declare properties, methods, and classes, respectively, that the property is immutable, that the method is not overridden, and that the class cannot be inherited. finally is part of the exception-handling statement structure, which indicates that it is always executed. Finalize is a method of the object class that, when executed by the garbage collector, calls this method of the reclaimed object, and can override this method to provide garbage collection of other resource recycles, such as closing the file.
Loader:Loader fromandroid3.0began to introduce. It makes theActivityOrFragmentLoading data asynchronously in a simple 50.Android How the client implements the automatic login answer: PasssharedpreferencesStore User Name,Password,Automatic sign-in function when storage is not empty

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.