当前位置:网站首页>Summary of Android knowledge points and common interview questions
Summary of Android knowledge points and common interview questions
2022-06-30 09:18:00 【An old dog ˉ】
Android Summary of knowledge points and common interview questions
- 1. The difference between linked list and array
- 2. List Hash The difference between arrays
- 3. Which three parties have been used SDK
- 4. Android Four components
- 5. The difference between heap and stack
- 6. Activity and Fragment The difference between
- 7. Commonly used ADB command
- 8. String,StringBuilder,StringBuffer The difference between
- 9. The difference between threads and thread pools
- 10. Android Project directory structure
- 11. build.gradle file
- 12. Activity Life cycle
- 13. heavy load
- 14. rewrite
- 15. Common abnormal
- 16. Activity and Window,View The relationship between
The following is a summary of my knowledge points and some questions I encountered during the interview , Here's a summary , Please correct any mistakes found , thank you .
1. The difference between linked list and array
- The query efficiency : Array query is more efficient ( Because it can be queried by subscript ), The efficiency of linked list query is low . So the array is used when there are many queries .
- Efficiency of addition and deletion : The efficiency of adding and deleting arrays is low ( Because you need to move, add or delete all the data behind the location ), The efficiency of adding and deleting linked lists is high . Therefore, the linked list is used when adding and deleting operations are frequent .
- Memory space : The memory space of the array is continuous , Fix . Dynamic allocation of linked list .
- Extensibility : Poor array scalability , The linked list has strong scalability . Because when the array is created , Fixed the memory size , When the memory is full, it cannot be expanded , You can only recreate . The linked list is to add a data , Allocate a little content space .
- Random read rate : High array random read rate , The random reading rate of linked list is low . Because the memory space of the array is continuous , And the linked list is scattered .
- Location : Array elements are in the stack area , The list elements are in the heap area
2. List Hash The difference between arrays
- Store the object :list Only objects can be stored , Arrays can store basic data types and objects ,hash Store key value pairs .
Be careful :
// There is no mistake in this case , It looks like an added basic data type , But it is automatically converted to the packaging type when adding .
ArrayList array = new ArrayList();
array.add(100);
- Storage order :List The data stored in is orderly , It is stored in the order of adding data . Array order .hash There is no order , The order of output data is not the order of storage .
- Whether the data is repeatable :List The data in is repeatable , The data in the array can be repeated ,hash The data in cannot be repeated , Because in HashMap Is data accessed through key value pairs , When key When I repeat , Will be the original value Replace the new value.
- Get the number of elements :List adopt size() Method , Array pass length attribute ,HashMap adopt size() Method .
3. Which three parties have been used SDK
- Bmob: Back end cloud .
- Wind weather : The interface .
- Aggregate data : Various data interfaces .
- Face++: Face recognition related technologies .
- arcsoft : Face recognition related technologies .
4. Android Four components
- Activity
- Service
- Broadcast Receiver
- Content Provider
5. The difference between heap and stack
- purpose : Heap memory is used to store new Created objects or arrays , Stack memory is used to store methods or local variables .
- The order : First in first out , last in last out . Stack in and out , Last in, first out .
6. Activity and Fragment The difference between
- Fragment yes Android3.0+ After that .
- Activity There can be multiple Fragment, and Fragment Can only be attached to one Activity.
- Fragment More flexible and lightweight .
7. Commonly used ADB command
Android Development commonly used ADB Command set
8. String,StringBuilder,StringBuffer The difference between
- Running speed :StringBuilder > StringBuffer > String.String The string is always on , and StringBuilder and StringBuffer For string variables . namely String Once created, variables cannot be changed , and StringBuilder and StringBuffer Changeable .
- Thread safety :StringBuffer Thread safety ,StringBuilder Thread unsafe .
String by final Modified class , Non inheritable . - Use scenario : Use when the string does not change very often String, Used when a single thread has a large number of string operations StringBuilder, When multithreading has a large number of string operations, use StringBuffer.
9. The difference between threads and thread pools
- Threads Thread Every time new When the object , Poor performance . The thread pool reuses existing threads , Reduce the creation of objects 、 The cost of extinction , High performance .
- New threads lack unified management , There may be situations where threads are created indefinitely , Compete with each other , Finally, the system resources are occupied to cause a crash or OOM. The thread pool can effectively control the maximum number of concurrent threads , Improve system resource utilization , Avoid system congestion caused by excessive resource competition .
- Threads lack some functionality , Such as scheduled execution , Do it regularly , Interrupt threads, etc . Thread pools provide these functions .
10. Android Project directory structure
Android The role of each folder in the project directory structure
11. build.gradle file
12. Activity Life cycle

Reference resources google Official documents
13. heavy load
- Same method name
- Return value , Parameter type , The number of parameters is not exactly the same
- Overloaded methods can change modifiers
14. rewrite
- The parameter list is the same as the overridden method
- The return type can be different , But it must be a subclass of the return type of the parent class
- The access permission cannot be lower than that of the overridden method
- Member methods of a parent class can only be overridden by subclasses
- final Methods that modify cannot be overridden
- static Methods that modify cannot be overridden , But again
- Children and parents are in the same package , Subclasses can override the parent class except final and private All the ways to modify
- Child and parent are not in the same package , Subclasses can only override the parent class pubilc、protected He Fei final Method
15. Common abnormal
- Compile time exception
SQLExecption
IOExecption
ClassNotFindExecption
FileNotFindExecption - Runtime exception
NullPointerExecption
StringIndexOutOfBoundsExecption
ArrayIndexOutOfBoundsExecption
ArithmeticExecption
ClassCastExecption
16. Activity and Window,View The relationship between
Activity When it is created attach() Method initializes one PhoneWindow( Inherited from Window), every last Activity Both contain one and only PhoneWindow.
Activity call setContentView() It's actually called getWindow().setContentView(), take View Set to PhoneWindow On , and PhoneWindow Inside is through WindowManager Of addView(),removeView(),updateViewLayout() These three ways to manage View Of .
WindowManager The essence is the interface , In the end by the WindowManagerImpl Realization .
If you have any questions, please chat privately or send an email ([email protected]) Discuss together
边栏推荐
- Opencv learning notes -day13 pixel value statistics calculation of maximum and minimum values, average values and standard deviations (use of minmaxloc() and meanstddev() functions)
- So the toolbar can still be used like this? The toolbar uses the most complete parsing. Netizen: finally, you don't have to always customize the title bar!
- Pytorch BERT
- Harmonyos actual combat - ten thousand words long article understanding service card development process
- 127.0.0.1, 0.0.0.0 and localhost
- Rew acoustic test (II): offline test
- Bottomsheetbehavior principle of realizing the home page effect of Gaode map
- Use Huawei performance management service to configure the sampling rate on demand
- Flink sql -- No factory implements ‘org. apache. flink. table. delegation. ExecutorFactory‘.
- Row column (vertical and horizontal table) conversion of SQL
猜你喜欢

Esp32 things (3): overview of the overall system design

Sort (simple description)

维基媒体基金会公布新商业产品“维基媒体企业”首批客户

Bottomsheetbehavior principle of realizing the home page effect of Gaode map

Anchorgenerator for mmdet line by line interpretation

Abstract factory pattern

Rew acoustic test (I): microphone calibration

Mmcv expanding CUDA operator beginner level chapter

7. know JNI and NDK

C#访问MongoDB并执行CRUD操作
随机推荐
What kind of experience is it to develop a "grandson" who will call himself "Grandpa"?
Pytorch BERT
Talk about how the kotlin process started?
Deep Learning with Pytorch- neural network
Deep Learning with Pytorch- A 60 Minute Blitz
Talk about writing
【付费推广】常见问题合集,推荐榜单FAQ
float
ES6 learning path (III) deconstruction assignment
Rew acoustic test (V): equipment required for test
Opencv learning notes-day6-7 (scroll bar operation demonstration is used to adjust image brightness and contrast, and createtrackbar() creates a scroll bar function)
Application of hongruan face recognition
Flink Exception -- No ExecutorFactory found to execute the application
Use V-IF with V-for
关于Lombok的@Data注解
Dart asynchronous task
Introduction to MySQL basics day3 power node [Lao Du] class notes
Opencv learning notes -day10 logical operation of image pixels (usage of rectangle function and rect function and bit related operation in openCV)
Use Huawei performance management service to configure the sampling rate on demand
Opencv learning notes-day5 (arithmetic operation of image pixels, add() addition function, subtract() subtraction function, divide() division function, multiply() multiplication function