preface
Many partners must be worried about the situation — “no chance of promotion, income peak, living expenses soaring, financial crisis follows”, xiabian before carefully collated some knowledge points about Android development, interview questions, recommended to solve the growing pains.
They are all my usual often reading, learning some information collection, including Java, Android advanced, architectural design, the NDK, audio and video technology development, cross-platform, the underlying source code, and normal line highlights the latest interview questions, and a consortium are Shared with everybody, help everybody to learn the way to inner ability get promoted, thinking with open ~
View
- What about the drawing process of a View?
- What is a MotionEvent? How many events are involved? Under what conditions does it occur?
- Describe the View event delivery and distribution mechanism?
- The difference between scrollTo() and scollBy()?
- How does Scroller achieve elastic sliding of View?
- How does invalidate() differ from postInvalidate()?
- What’s the difference between SurfaceView and View?
- How does custom View consider model adaptation?
Activity
- Talk about the Activity lifecycle
- What methods does Activity B call when Activity A starts another Activity? What if B is a transparent theme or a DialogActivity?
- What does the onSaveInstanceState() method do? When is it called?
- Describe the four startup modes and application scenarios of the Activity
- Know which Flags are commonly used for activities
- Let’s talk about the relationship between an Activity and a Window or view
- The Activity life cycle changes when switching between horizontal and vertical screens
- How do I start an Activity for another application
- The starting process of an Activity
Fragment
- Why is Fragment called the fifth component
- Two ways to load fragments into an Activity
- Fragment used with ViewPager
- Fragment life cycle
- Call methods in the Activity in the Fragment
- Call the Fragment method in the Activity
- Call another Fragment method in the Fragment
- Fragment switching mode
- Talk about the difference between activities and fragments
- The difference between add and replace in fragments
- The difference between getFragmentManager, getSupportFragmentManager, getChildFragmentManager
- FragmentPagerAdapter and FragmentStatePagerAdapter difference and usage scenarios
Bitmap
- What do you need to be aware of when using Bitmap
- Will bitmap.recycle () be recycled immediately? When will it be recycled? If there’s nowhere to use this Bitmap, why isn’t garbage collection just collected
- The memory occupied by a Bitmap and the calculation of the memory occupied
- Cache update policy in Android
- The principle of the LRU
- The Service and BroadcastReceiver
- Talk about the Service lifecycle
- What are the two ways to start a Service? Where is the difference between
- How can Service not be killed
- Can Service start time-consuming operation? How to do
- Which system services have you used
- Do you know ActivityManagerService? What role to play
- How many forms of broadcasting are there? What are the features
- Two ways to register a broadcast
- Do you understand the principle of broadcast sending and receiving? (Binder mechanism, AMS)
Handler
- What about the message mechanism Handler function? What are the elements? What is the process
- Can a thread create more than one Handler, Handler and Looper
- The difference between soft and weak references
- Causes of memory leaks caused by handlers and the optimal solution
- Why does the system not recommend accessing the UI on child threads
- Why does Looper loop death not cause apps to freeze
- What happens to message queues when you use Handler’s postDealy
- Can I just new a Handler on a child thread? How to do
- How can messages be created? Which works better and why
Performance optimization
- In the image level 3 cache, the image is loaded into memory, and if memory is about to burst, what happens? How to deal with
- If you load a 500*500 PNG hd image in memory. How much memory should be used
- WebView performance optimization
- How does Bitmap handle large images, such as a 30M large image, and how does it prevent OOM
- Memory reclamation mechanism and GC algorithm (advantages and disadvantages of various algorithms and application scenarios); GC principles, timing, and GC objects
- What’s the difference between a memory leak and an overflow? What tools does AS have to detect memory leaks
- Performance optimization, how to ensure that the application startup does not lag? How to deal with black and white screen
- If a strong reference is set to NULL, it will be reclaimed
- RecyclerView and ListView
- What is the Adapter of the ListView
- LinearLayout, FrameLayout, RelativeLayout performance comparison
Design patterns
- What design patterns do you know
- Talk about MVC, MVP, and MVVM. What’s good and what’s bad
- After encapsulating the P layer. If the data at the P layer is too large, how can I solve the problem
- Can you give some examples from Android of what design patterns are used
- What are the differences between decorator mode and proxy mode
- How many ways are there to implement the singleton pattern? What is the purpose of double locking in the slacker style? What is the purpose of two short calls
- Use of some open source framework, introduced a read source code, internal implementation process
- How should fragments be decoupled if used in Adapter
thread
- What are the benefits of thread pools? Four kinds of thread pool usage scenarios, the understanding of several parameters of the thread pool
- Learn about other classes in Android that facilitate thread switching
- Explain how AsyncTask works
- What does IntentService do
- The difference between creating a thread directly in an Activity versus creating a thread in a service
- The work policy of ThreadPoolExecutor
- Differences between Handler, Thread, and HandlerThread
- The principle of ThreadLocal
- Is multithreading always efficient (pros and cons)
- In multithreading, if you were to do a singleton, what would you do
- Is there any other way to wake up a thread besides notify
- What is ANR? When does ANR occur? How to avoid it? How can I quickly locate ANR problems without looking at the code
algorithm
- The level depth of the ViewGroup is converted to the level depth of the binary tree
- Find the intersection of two strings and problems in string 1 that are not in string 2
- String Adds the digits of a String
- Print an ordered array using three threads in sequence
- Given an ordered array and a number of targets, find the index nearest the number of targets in log(n) time
- The depth and breadth of a binary tree requires a traversal
- Given a binary tree and a target number, whether there is a case in the binary tree where the sum of all nodes of a path is the same as the target number, and print
- Start at (0,0), go up, down, left, right,0 is unblocked, 1 is blocked, target position (k,j), ask if you can reach this position
- Int array, in which all but one number appears twice, find the number that appears only once
- An unordered int array, given a target number, find the array of two numbers to add to target, and output coordinates
- Array containing 1-3 of 3 kinds of figures, such as,2,3,1,2,2,1,3,3 [1], the sort of,1,1,2,2,2,3,3,3 [1], requires the time complexity, follow-up the content into an object, continue to sorting
- 1~100 lamps, all are bright, the first time will be divisible by 1 lamp, dimmed, the second time will be divisible by 2 lamp, dimmed, the third time will be divisible by 3 lamp, dimmed… Press the number divisible by 100 for the 100th time and ask how many lights are on at the end
The last
I hope that these learning documents can help you learn. In order to save the time for you to search for information online, I will upload these learning materials to [” Github “] “click to view”, and you can also share them with friends around to learn together.
If you like this article, please feel free to like it and comment on it.