Reprinted: Http://www.jianshu.com/p/d791bbede02cStep 1. Play Turn Rxjava
Using Rxjava to handle asynchronous is extremely convenient, various operators can do the pipelining operation of the data, combined with the retrofit, make the Andorid development become extremely simple. The only drawback is that Rxjava does not conform to our previous programming ideas, learning Rxjava exist a certain degree of difficulty, many engineers to Rxjava can not fully understand. However, believe that the following 2 content will give you a clearer understanding of the use of Rxjava.
- RxJava for Android Developers
- Open Source Project Hello-rxjava lets you thoroughly understand Rxjava's asynchronous programming.
You can see clearly what threads are happening in the operation
Project Address: Https://github.com/xinghongfei/Hello-RxJava
Step 2. Custom View
The custom view has four main parts:
- Drawing mechanism: Mastering the use of Onmeasure,onlayout,ondraw and related classes.
- Event passing mechanism: Mastering the related Logic of Dispathtouchevent (), Oninterceptevent (), Ontouchevent ().
- Property Animation: Because the property animation core is a change in value. Using attribute animations in Custom view makes it easy to transform numeric values.
- Related gesture classes.
Everything you need is here Https://github.com/xinghongfei/awesome-viewStep 3. Inter-process communication and process keepalive
- Inter-process communication
interprocess communication is usually done in the following 7 ways:
- Bundle: Mainly in the intent, transfer between the four components.
- File sharing: A process to write a file, a process to read a file.
- Sharedpreferences: Concurrency not supported, underlying XML based.
- Messenger: The bottom layer is communication through the IPC, which is mainly the transfer of data between processes and does not support concurrency.
- Socket: Based on TCP protocol.
- Aidl: Supports concurrency, a process that can invoke methods of another process.
- ContentProvider: Data sharing among different applications.
Detailed: "Android development Art inquiry" interprocess communication reading notes
2. Process KeepAlive
Android process life-preserving moves Daquan
On the viability of Android application process
Android Client background KeepAlive experience sharing
Open Source Project Hello-daemon
Daemon.gif
Project Address Https://github.com/xinghongfei/Hello-Daemon
Step 4. Hot fix
Online program appeared bug, must have Miaoshouhuichun ability, want to become a Andorid senior engineer, this is necessary skills.
There are a lot of heat repair frameworks on the market now, the following are the four common types.
|
Tinker |
QZone |
andfix |
dexposed |
| Class substitution |
Yes |
Yes |
No |
No |
| So replace |
Yes |
No |
No |
No |
| Resource substitution |
Yes |
Yes |
No |
No |
| Full platform Support |
Yes |
Yes |
Yes |
No |
| Immediate effect |
No |
No |
Yes |
Yes |
| Performance loss |
Smaller |
Larger |
Smaller |
Smaller |
| Patch Pack Size |
Smaller |
Larger |
So so |
So so |
| Transparent development |
Yes |
Yes |
No |
No |
| Complexity of |
Lower |
Lower |
Complex |
Complex |
| Gradle Support |
Yes |
No |
No |
No |
| Interface documentation |
Rich |
Less |
So so |
Less |
| Rom Volume |
Dalvik larger |
Smaller |
Smaller |
Smaller |
| Success |
Higher |
Highest |
So so |
So so |
Overall:
- Dexposed does not support the full platform and is not suitable for use in commercial products.
- Andfix as a native solution, the first is the stability and compatibility issues, and more importantly, it is unable to implement class substitution, it requires a lot of additional development costs.
-
The main problem with the Qzone solution is the performance of the Dalvik, and the rapid increase of the patch pack in order to solve the problem of memory address under art.
The Tinker Hot patch scheme not only supports the substitution of classes, so, and resources, it is still 2. X-7.x's full platform support. It does not need to be inserted, and the patch size is much smaller than other scenarios. The tinker is already running on hundreds of millions of Android devices.
Android Hot Patch Dynamic Repair Framework Summary
Android Hot patch Dynamic Repair Technology Series
Introduction to the hot patch dynamic repair technology for Android app
The following project is a demo based on the hot fix Framework tinker and summarizes some common issues.
Tinker.gif
Project Address Https://github.com/xinghongfei/Hello-Tinker
Step 5. Architecture
The common architectures are: MVC,MVP,MVVM. The most used is the MVC architecture, and many applications now use the MVP architecture, and MVVM has little to do with it.
Architucture.png
Android app Design Architecture: MVC,MVP,MVVM and architecture experience
Google's Android-architecture
Android Data Binding
The following project is a particularly simple MVP architecture framework that simulates file downloads.
Mvp.gif
Project Address Https://github.com/xinghongfei/Hello-MVP
Essential Skills for Android engineers