In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the knowledge points of Android interview". Friends who are interested might as well take a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what are the knowledge points of Android interview"?
Four components of Android and their Application scenarios
Activity: the component responsible for interacting with users in Android applications.
Service: often used to provide background services for other components or to monitor the running status of other components. It is often used to perform time-consuming operations.
BroadcastReceiver: used to listen to other components in the application.
Real-time data exchange between ContentProvider:Android applications.
1. The life cycle of Activity
Life cycle: when the object is born, when it dies, how to write the code, where the code is written.
Note:
When a new Activity is opened and the transparent theme is adopted, the current Activity will not call back the onStop
OnCreate and onDestroy pairing, onStart and onStop pairing (visible), onResume and onPause pairing (whether it is in the foreground, can interact with the user)
When you open a new Activity, the relevant Log is:
Main1Activity: onPause Main2Activity: onCreate Main2Activity: onStart Main2Activity: onResume MainA1ctivity: onStop
Life cycle in an abnormal state:
Resource-related system configuration changes or insufficient resources: for example, if the screen is rotated, the current Activity will be destroyed, and the onSaveInstanceState will be called back before onStop to save the data, and the onRestoreInstanceState will be called back after onStart when the Activity is recreated. Where Bundle data is passed to onCreate (not necessarily data) and onRestoreInstanceState (there must be data).
To prevent rebuilding when the screen is rotated, add the configuration to the manifest file:
Android:configChanges= "orientation"
2. The life cycle of Fragment
Normal start
Activity: onCreate Fragment: onAttach Fragment: onCreate Fragment: onCreateView Fragment: onActivityCreated Activity: onStart Activity: onResume
Normal exit
Activity: onPause Activity: onStop Fragment: onDestroyView Fragment: onDestroy Fragment: onDetach Activity: onDestroy
3. The startup mode of Activity
Standard: each time Activity is activated (startActivity), an instance of Activity is created and placed on the task stack
SingleTop: if an Activity activates itself, that is, the Activity is at the top of the task stack, you do not need to create it. In other cases, you need to create an Activity instance.
SingleTask: if the Activity you want to activate has this instance in the task stack, you don't need to create it, just put the Activity at the top of the stack, that is, pop all the Activity instances above the Activity and call its onNewIntent.
SingleInstance: a MainActivity instance has been created in the task stack of App 1. If App 2 also wants to activate MainActivity, there is no need to create it. The two applications share the Activity instance.
4. The value passed between Activity and Fragment
Through findFragmentByTag or getActivity to get each other's reference (strong turn), and then call each other's public method, but to do so is to introduce a "strong turn" of the ugly code, the other two classes hold each other's strong reference, the coupling is large, easy to cause memory leaks.
Pass the value through the method of Bundle, such as the following code:
/ / set some parameters fragment.setArguments (bundle) for fragment in Activity; / / get the method Bundle arguments = getArguments () in Activity through getArguments in fragment
3. Using eventbus for communication, this method has high real-time performance, and the Activity and Fragment can be completely decoupled.
The code in / / Activity EventBus.getDefault () .post ("message"); / / the code in Fragment EventBus.getDefault () .register (this); @ Subscribe public void test (String text) {tv_test.setText (text);}
5 、 Service
There are two types of Service:
The local service, which belongs to the same application, is started by startService or bound and obtained by bindService. If you just want to set up a service to run in the background, you can directly startService. If you need to pass values or operations to each other, you should use bindService.
Remote services (between different applications) that bind and get proxy objects through bindService.
The corresponding life cycle is as follows:
Context.startService ()-> onCreate ()-> onStartCommand ()-> Service running-- call context.stopService ()-> onDestroy () context.bindService ()-> onCreate ()-> onBind ()-> Service running-- call > onUnbind ()-> onDestroy ()
Be careful
Service runs on main threads by default, so if you need to perform time-consuming operations in Service (operations on large files, copies of databases, network requests, file downloads, etc.), they should be done in child threads.
! The special case is that Service specifies in the manifest file to run in other processes.
6. Message passing mechanism in Android
Why use Handler?
Because the screen is refreshed at a frequency of 60Hz, about once every 16 milliseconds, in order to ensure the fluency of UI, time-consuming operations need to be handled in child threads, which cannot update UI directly. Therefore, Handler is required to send a message to the main thread in the subthread to update the UI.
A little further here, the UI control in Android is not thread-safe, so it can cause the UI control to be in an unpredictable state when multiple threads access the UI concurrently. Google does not deal with this problem through the locking mechanism because:
The introduction of locks will complicate the operation of UI.
The introduction of locks will reduce the running efficiency of UI.
Therefore, Google engineers operate UI through a single-threaded model, and developers only need to cut flowers between different threads through Handler.
An overview of the messaging mechanism in Android?
The message mechanism in Android mainly refers to the running mechanism of Handler. Handler is the key to thread switching, and switching between main threads and child threads is just a special usage scenario. The things that the messaging mechanism needs to know are the MessageQueue objects in Message, Handler, Looper, and Looper.
As shown in the figure above, we can think of the entire messaging mechanism as a pipeline. Where:
MessageQueue is the conveyor belt and is responsible for the transmission and management of Message queues.
Looper is the engine of the pipeline, constantly taking messages out of the message queue and handing them over to Handler for processing.
Message is every product.
Handler is a worker. But this analogy is not appropriate, because it is Handler that sends and ultimately processes the Message.
Why does creating a Handler in a child thread throw an exception?
The work of Handler depends on Looper, while Looper (and message queuing) belongs to a thread (ThreadLocal is a data storage class within a thread through which data can be stored in a specified thread and cannot be accessed by other threads), and cannot be accessed by other threads. So the Handler is indirectly bound to the thread. So to use Handler, you must make sure that the thread created by Handler has a Looper object and starts the loop. Because there is no Looper by default in the child thread, an error will be reported.
The correct way to use it is:
Handler = null; new Thread (new Runnable () {private Looper mLooper) @ Override public void run () {/ / you must call the prepare method of Looper to create a Looper object for the current thread, and then start the loop / / prepare method which essentially creates a Looper object for the ThreadLocal object / / if the current thread has already created a Looper object, it will report an error Looper.prepare () Handler = new Handler (); / / get the Looper object mLooper = Looper.myLooper (); / / start the message loop Looper.loop (); / / exit the Looper message loop when appropriate to prevent memory leaks mLooper.quit ();}}. Start ()
The Looper is created and the message loop is started by default in the main thread, so there is no error:
The entry to the application is the main method of ActivityThread, where the Looper is created and the loop method of Looper is executed to start the message loop so that the application runs all the time.
Can a child thread send a message to the main thread through Handler?
Sure. Sometimes, for business needs, the main thread can send messages to child threads. The Handler of the child thread must be created as described above and associated with the Looper.
7. Event delivery mechanism and custom View related
View tree of Android
The mechanism of View in Android is mainly the display of Activity. Each Activity has a Window (the implementation class in the mobile phone is PhoneWindow). Under Window, there are TitleVie and ContentView under DecorView,DecorView, and ContentView is specified by setContentView in Activity.
Event transmission and distribution mechanism
ViewGroup has the following three methods for event distribution, while View has only dispatchTouchEvent and onTouchEvent.
@ Override public boolean dispatchTouchEvent (MotionEvent ev) {return super.dispatchTouchEvent (ev);} @ Override public boolean onInterceptTouchEvent (MotionEvent ev) {return super.onInterceptTouchEvent (ev);} @ Override public boolean onTouchEvent (MotionEvent event) {return super.onTouchEvent (event);}
Events are always distributed from top to bottom, that is, first to Activity, then to ViewGroup, then to sub-View, and if there are no view consumption events, events are passed back along the path. Where:
DispatchTouchEvent is the event distribution method, if the event can reach the view, it will be called first, usually we do not modify this method.
OnInterceptTouchEvent is the core method of event distribution, indicating whether the ViewGroup intercepts the event. If true is returned, the onTouchEvent of the ViewGroup will be called and the event will not be passed down.
OnTouchEvent is * level, and * is called in event distribution.
The child View can ask the parent element not to intercept through the requestDisallowInterceptTouchEvent method.
Be careful
Events are passed from Activity.dispatchTouchEvent () and all the way down (child View) from the uppermost View (ViewGroup) as long as they are not stopped or intercepted. The child View can handle the event through onTouchEvent ().
Events passed by the parent View (ViewGroup) to the child View,ViewGroup can be intercepted by onInterceptTouchEvent () and stopped passing down.
If the event has not been stopped from top to bottom, and there is no consumption event in the layer View, the event will be passed upwards in reverse. In this case, the parent View (ViewGroup) can consume it. If it is still not consumed, * will go to the onTouchEvent () function of Activity.
If View does not consume ACTION_DOWN, other events that follow will not be passed.
OnTouchListener takes precedence over onTouchEvent () to consume events.
Customize the classification of View
Extend existing subclasses of View, such as overriding onDraw methods, extending new functions, and so on.
Custom composite controls, combining some commonly used controls for ease of use.
Directly inheriting View to realize the complete customization of View, it is necessary to complete the measurement and drawing of View.
Custom ViewGroup, need to copy the onLayout to complete the determination of the location of the sub-View and other work.
Measurement of View-onMeasure
The final measurement of View is to set the two MeasureSpec representing width and height to View through setMeasuredDimension in the onMeasure method, so it is necessary to master MeasureSpec. MeasureSpec includes size information as well as schema information.
Three modes of MeasureSpec:
EXACTLY mode: precise mode, corresponding to when the user specifies as match_parent or a specific size (in fact, specifying as match_parent essentially specifies the size as the size of the parent container)
AT_MOST mode: corresponding to the wrap_content specified by the user, the size of the control does not exceed the allowed size of the parent control.
UNSPECIFIED mode: measurement mode that does not specify a size, which is rarely used
Here is the template code:
Public class MeasureUtils {/ * for View measurement * * @ param measureSpec * @ param defaultSize * @ return * / public static int measureView (int measureSpec, int defaultSize) {int measureSize / / get the size specified by the user and the mode int mode = View.MeasureSpec.getMode (measureSpec); int size = View.MeasureSpec.getSize (measureSpec) / / return size if according to mode (mode = = View.MeasureSpec.EXACTLY) {/ / precise mode (specify size and match_parent) directly return specified size measureSize = size } if else {/ / UNSPECIFIED mode, AT_MOST mode (wrap_content), the default size measureSize = defaultSize is required. In if (mode = = View.MeasureSpec.AT_MOST) {/ / AT_MOST (wrap_content) mode, you need to take the minimum measured value and default value measureSize = Math.min (measureSize, defaultSize);}} return measureSize;}}
*, copy the onMeasure method and remove the super method:
@ Override protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec) {setMeasuredDimension (MeasureUtils.measureView (widthMeasureSpec, 200), MeasureUtils.measureView (heightMeasureSpec, 200);}
Drawing of View-onDraw
To draw View, you need to master the coordinate system of View in Android:
The coordinate system of View takes the upper left corner as the origin, the right direction is the positive direction of X axis, and the downward direction is the positive direction of Y axis.
View rendering is mainly done through the 2D drawing mechanism of Android, and the timing is in the onDraw method, including canvas Canvas and brush Paint. Let's show you the example code. The relevant API is not the focus of the introduction, the focus is on the save and restore methods of Canvas. After save, you can zoom in, rotate, tilt and other operations on the canvas. These two methods are generally used together, in which save can be called more often than restore.
@ Override protected void onDraw (Canvas canvas) {super.onDraw (canvas); Bitmap bitmap = ImageUtils.drawable2Bitmap (mDrawable); canvas.drawBitmap (bitmap, getLeft (), getTop (), mPaint); canvas.save (); / / Note that the rotation here refers to the rotation of the canvas canvas.rotate (90); mPaint.setColor (Color.parseColor ("# FF4081")); mPaint.setTextSize (30) Canvas.drawText ("Test", 100,100, mPaint); canvas.restore ();}
Location of View-onLayout
Related to the layout location is the copy of the onLayout method. In general, when we customize the View, we only need to complete the measurement and drawing. If you are customizing ViewGroup, all you need to do is measure yourself and control the layout position of child controls in onLayout. OnLayout is a method that must be implemented in custom ViewGroup.
8. Performance optimization
Layout optimization
1. Using the include tag, reuse the same layout through the layout attribute.
two。 Use merge tags to remove views of the same kind
3. Delayed loading of layouts using ViewStub for layouts that are not immediately used. For example, in the list page, the list is not loaded until you get the data, which makes the UI smooth.
/ / you need to call the inflate method manually before the layout is displayed. Stub.inflate (); / / where the setVisibility also calls the inflate method / / stub.setVisibility (View.VISIBLE) at the bottom; / / after that, if you want to use the View in the ViewStub tag, you just need to follow the usual. TextView tv_1 = (TextView) findViewById (R.id.tv_1)
4. Use RelativeLayout as much as possible, because it greatly reduces the hierarchy of the view.
Memory optimization
Memory optimization should be considered in both the APP design and code writing phases:
1. Cherish Service and try to keep Service running when it is in use. Use IntentService as much as possible
IntentService is actually implemented internally through threads and Handler. When a new Intent arrives, it creates a thread and processes the Intent, and then automatically destroys itself. Therefore, using IntentService can save system resources.
two。 Release resources when memory is tight (for example, when UI is hidden). Overrides the callback method of Activity.
@ Override public void onLowMemory () {super.onLowMemory ();} @ Override public void onTrimMemory (int level) {super.onTrimMemory (level); switch (level) {case TRIM_MEMORY_COMPLETE: / /. Break; case other:}}
3. Configure more memory for Application through Manifest, but it is generally not recommended
Android:largeHeap= "true"
4. To avoid the waste of Bitmap, you should try to adapt the screen equipment. Try to use mature picture loading framework, Picasso,Fresco,Glide, etc.
5. Use optimized containers, SparseArray, etc.
6. Other suggestions: use enumerated variables as little as possible, use as little abstraction as possible, add as few classes as possible, avoid using dependency injection frameworks, be cautious about using library, use code confusion, consider using multiple processes when situations, etc.
7. Avoid memory leaks (objects that should have been recycled are not recycled). Once the memory of APP grows rapidly in a short period of time or GC is very frequent, you should consider whether it is caused by memory leaks.
Analytical method.
1. Use the Memory tool in Android Monitors provided by Android Studio to see how much memory is being used and what is not.
two。 Use the Heap tool provided by DDMS to view memory usage, or you can trigger GC manually.
3. Use dependent libraries for performance analysis, such as Square's LeakCanary, which will notify you through Notification before and after memory leaks.
What will cause a memory leak?
1. Resource release problem: a problem with program code that keeps references to certain resources, such as Context, Cursor, and IO streams, for a long time, resulting in memory leaks when resources are not released.
two。 Excessive object memory problem: multiple objects that consume too much memory (such as Bitmap, XML files) are saved, resulting in memory exceeding the limit.
3. The use of the static keyword: static is a keyword in Java, and when it is used to modify a member variable, then the variable belongs to the class, not an instance of the class. So variables modified with static have a long life cycle, and should be treated with caution if you use it to refer to instances that consume too much resources (in the case of Context).
Solution
1. Try to avoid static member variables referencing instances that consume too much resources, such as Context.
2. Context uses ApplicationContext as much as possible, because the life cycle of Application's Context is relatively long, and there is no memory leak when referencing it.
3. Use WeakReference instead of strong references. For example, you can use WeakReference mContextRef
4. Thread causes memory overflow: the main reason for thread memory leak is that the thread life cycle is uncontrollable. For example, the Thread in Activity is in run, but the Activity is recreated for some reason, but the Thread will still run, because the Thread will not be destroyed until the run method ends.
Solution
1. Change the inner class of the thread to a static inner class (because the non-static inner class has a strong reference to the external class object, while the static class does not).
two。 Context references are saved with weak references within the thread.
Methods and tools for viewing memory leaks
Official tools provided by android: Memory Monitor (when the memory occupied by APP grows rapidly in a short period of time or GC becomes frequent), Heap tool provided by DDMS (manually triggers GC)
Square provides a memory leak detection tool, LeakCanary (can automatically complete memory tracking, detection, output results), for demonstration, and appropriate interpretation.
Performance optimization
To prevent overpainting, you can view overpainting by turning on the phone's "Show overdrawn area".
Minimize rendering time, use the view tree to view the nodes, and analyze the performance of the nodes.
Data collection and analysis are carried out through TraceView. When there is an approximate location, use the Debug class provided officially by Android for collection. * the .trace file can be opened through DDMS to analyze the call of the function (including the execution time and the number of calls under specified circumstances).
/ / enable data acquisition Debug.startMethodTracing ("test.trace"); / / disable Debug.stopMethodTracing ()
OOM
Some common ways to avoid OOM:
1. Use as few large images as possible in App resources. When using Bitmap, you should pay attention to the proportional reduction of the picture, and pay attention to the recycling of Bitmap.
BitmapFactory.Options options = new BitmapFactory.Option (); options.inSampleSize = 2; / / Options saves only the size of the picture, but does not save the picture to memory BitmapFactory.Options opts = new BitmapFactory.Options (); opts.inSampleSize = 2; Bitmap bmp = null; bmp = BitmapFactory.decodeResource (getResources (), mImageIds [position], opts); / / Recycle bmp.recycle ()
two。 Release resources in combination with the lifecycle of components
3. IO streams, cursors for database queries, etc., should be closed in time after use.
4. ViewHolder mode should be used to cache ConverView in ListView
5. Try to pass (reuse) some objects when switching pages
ANR
The time at which ANR occurs in different components varies. The main thread (Activity, Service) is 5 seconds, and BroadCastReceiver is 10 seconds.
There are generally three types of ANR:
1. KeyDispatchTimeout (5 seconds)
The main type of keystroke or touch event does not respond within a specific time
2. BroadcastTimeout (10 seconds)
BroadcastReceiver cannot be processed within a specific time
3. ServiceTimeout (20 seconds)
The low probability type Service cannot be processed within a specific time.
Solution:
1. The UI thread only performs UI-related operations. All time-consuming operations, such as accessing the network, Socket communication, querying a large number of SQL statements, complex logic calculations, etc., are placed in sub-threads, and then update the UI through handler.sendMessage, runonUITread, AsyncTask, and so on.
two。 In any case, make sure that the user interface operates smoothly. If the time-consuming operation requires the user to wait, a progress bar can be displayed on the interface.
3. When BroadCastReceiver wants to perform complex operations, you can start a Service in the onReceive () method to handle it.
9. 9 cut pictures (.9 pictures), SVG pictures
Nine-cut map
The nine-point picture is a special format used in Android development, and the file name ends with ".9.png". This kind of picture can tell the program which part of the image can be pulled up and which part can not be pulled up needs to keep the original ratio. The use of point nine pictures can ensure that the pictures are self-adaptive without blurring and deformation. The point nine picture is often used in the background picture of the dialog box.
Part 1 and part 2 specify the stretchable part of the image. When the width and height of the dialog box is set in the actual program, part 1 and part 2 will be stretched to the desired height and width, showing the same visual effect as the design draft.
Part 3 and 4 define the content area of the image. The content area specifies the editable area, for example, the text needs to be wrapped in it.
SCG Vector Animation Mechanism of android5.0
There will be no loss of image quality when the image is scaled down.
Use XML to define drawings
Adapt to different resolutions
10. Common data storage methods in Android
Files (including XML, SharePreference, etc.)
Database
Content Provider
Save on the network
11. Interprocess communication
What are the methods of interprocess communication in android?
Operating system:
Windows: clipboard, piping, mail slot, etc.
Linux: named pipes, shared memory, semaphores
The way processes communicate in Android is not entirely inherited from Linux:
Bundle
File sharing
AIDL
Messenger
Content Provider
Socket
12. Common network frameworks
Commonly used http frameworks and their characteristics
HttpURLConnection: prior to Android 2.2, HttpClient had less bug, so using it was a * * choice. In Android version 2.3 and later, HttpURLConnection is the choice of choice. Its API is simple and small, so it is very suitable for Android projects. Compression and caching mechanism can effectively reduce the traffic of network access, and also play an important role in improving speed and saving power. For new applications, we should be more inclined to use HttpURLConnection, because we will spend more time optimizing HttpURLConnection in our future work. Features: relatively light, flexible, easy to expand, after 3.0 and 4.0 have been improved, such as support for HTTPS, in 4.0, also added support for caching.
HttpClient: efficient and stable, but the maintenance cost is high, so the android development team is reluctant to maintain the library and switch to a lighter one
OkHttp:okhttp is a HTTP+SPDY client development kit for Java, which also supports Android. More than Android 2.3 is required. Features: OKHttp is an Android version of Http client. Very efficient, supporting SPDY, connection pooling, GZIP, and HTTP caching. By default, OKHttp automatically handles common network problems, such as secondary connections and SSL handshakes. If you integrate OKHttp,Retrofit into your application, OKHttp will be used by default to handle other network layer requests. Starting with Android4.4, the underlying implementation of HttpURLConnection uses okHttp.
Volley: the early use of HttpClient, and later the use of HttpURLConnection, is a web request framework launched by Google in 2013, which is very suitable for network operations with small amount of data but frequent communications, while for network operations with a large amount of data, such as downloading files, the performance of Volley will be very poor.
Xutils: cache network request data
Retrofit: similar to the request method of the Volley framework, the underlying network request uses okhttp (high efficiency, android4.4 uses okhttp), and annotations are used to specify the request method and url address, thus reducing the amount of code.
AsyncTask
13, commonly used picture loading framework and features, source code
Picasso:PicassoSquare 's network library can play a role together, because Picasso can choose to hand over the cache portion of the network request to the okhttp implementation.
Glide: imitates Picasso's API, and adds a lot of extensions (such as gif, etc.) to support image streaming, so it is more used in video applications such as sex shooting.
There is a module called image pipeline designed in Fresco:Fresco. It is responsible for loading pictures from the network, from the local file system, from local resources. In order to save space and CPU time, it contains 3-level cache design (2-level memory, 1-level files). There is a module called Drawees in Fresco, which can easily display the loading diagram and release the memory and space in time when the picture is no longer displayed on the screen.
Fresco caches pictures in Ashmem (system anonymous memory sharing area).
Heap- heap memory: the Java heap memory size of each App in Android is strictly limited. Each object is instantiated in heap memory using Java's new, which is a relatively safe area of memory. There is a garbage collection mechanism in memory, so when App is no longer using memory, the system will automatically collect this piece of memory. Unfortunately, the process of garbage collection of memory is the problem. When the memory is garbage collected, the memory is not only garbage collected, but also the Android application is completely terminated. This is one of the most common reasons why users get stuttered or temporarily fake death when using App.
When Ashmem:Android operates on the Ashmem heap, it extracts the area of memory in which data is stored in the heap from the Ashmem heap instead of freeing it, which is a weak memory release mode; the extracted memory is released only when the system really needs more memory (the system memory is insufficient). When Android stores the extracted part back to the Ashmem heap, as long as the extracted memory space is not freed, the previous data will be restored to the corresponding location.
No matter what happens, the garbage collector does not automatically recycle these Bitmap. When the Android rendering system is rendering these images, the Android system library will extract the Bitmap from the Ashmem heap, and when the rendering is finished, the Bitmap will be put back to its original location. If an extracted image needs to be drawn again, the system only needs to decode it again, which is very fast.
14. What is used to communicate between threads in Android development?
The traditional way to point is to synchronize some data into the code block and then use a callback to let another thread read it. In Android I usually create a Looper thread and then Hanlder passes the message.
Related to the new features of 1***ndroid
5.0:Material Design, support for multiple devices, support for 64-bit ART virtual machines, Project Volta battery life improvement program, etc.
6.0: dynamic rights management, excessive animation, payment, fingerprinting, etc.
7.0: split screen, quick reply to notification message, night mode, traffic protection mode, etc.
16. Network request optimization
Network request optimization
Can be cached as far as possible to cache up, reduce the pressure on the server. For example, some data of the home page in APP, such as the icon and copy of the home page, are cached, and the data specified through the network can make app have more flexibility.
Do not use the domain name, use IP direct connection, omitting the DNS domain name resolution.
Connection multiplexing, request merging, and request data Body can be compressed using the compression algorithm Gzip, using JSON instead of XML
Security of network requests
I don't know much about this area. Let me tell you my idea. Using hashing algorithms such as MD5, the data given to us by the server can be encrypted by timestamp and other parameters to get a key. After the data is taken out by the client, the key is generated according to the data and timestamp and compared with that given by the server.
17. Related to new technology
RXJava: an asynchronous request library, the core of which is asynchronous. Using an extended mode of observation, when the observed changes, it can pass through the observer through events (onNext, onError, onComplete) and so on. RXJava supports both thread scheduling and switching, and users can specify the thread on which the subscription occurs and the thread triggered by the observer.
Retrofit: specify URL and request method through annotations. In essence, the underlying layer is implemented through OKHttp.
At this point, I believe you have a deeper understanding of "what are the knowledge points of Android interview?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.