Step 1. Play with RxJava
The ease of handling asynchrony with RxJava, the pipelining of various operators on data, combined with Retrofit, makes Android ID development extremely simple. The only fly in the ointment is that RxJava is not in line with our past programming ideas, there is some difficulty in learning RxJava, many engineers do not fully understand RxJava. However, I believe the following two items will give you a clearer idea of how to use Rxjava.
- Introduction to RxJava
RxJava for Android developers - RxJava advanced open source project Hello – RxJava gives you a thorough understanding of asynchronous programming in RxJava.
Can you clearly see on what thread the operation is taking place
Project address: github.com/xinghongfei…
Step 2. Customize the view
Customized View mainly master the following four parts:
- Drawing mechanism: master onMeasure onLayout, ontouch and the use of related classes.
- Event passing mechanism: Master the related logic of dispathTouchEvent(),onInterceptEvent(),onTouchEvent().
- Attribute animation: Because the core of attribute animation is the change of log value. Using property animations in custom views makes it easy to transform values.
- Related gesture classes.
Everything you need is right hereGithub.com/xinghongfei…
Step 3. Interprocess communication and process survival
- Bundles: These are placed in intEnts and passed between the four major components.
- File sharing: One process writes files and one process reads files.
- SharedPreferences: Does not support concurrency and is based on XML.
- Messenger: The underlying communication is through IPC, mainly between processes to transfer data, does not support concurrency.
- Socket: based on TCP.
- AIDL: Supports concurrency, where one process can call another process’s methods.
- ContentProvider: Sharing data between different applications. Best explanation: Interprocess communication reading notes for Android Development Art Exploration
2. The process survives
Android process to keep alive
On the viability of Android application persistence
Wechat Android client background preservation experience sharing
Open source project Hello-Daemon
daemon.gif
Project address github.com/xinghongfei…
Step 4. Heat repair
If there are bugs in online programs, you have to have the ability to make things right. If you want to be an Andorid expert, this is a necessary skill. Android Hot patch Dynamic repair technology series Android App hot patch dynamic repair technology introduction
There are many thermal repair frames on the market. Here are four common ones.
Tinker | QZone | AndFix | Dexposed | |
---|---|---|---|---|
Class to replace | yes | yes | no | no |
So to replace | yes | no | no | no |
Resources to replace | yes | yes | no | no |
Full platform support | yes | yes | yes | no |
Effective immediately | no | no | yes | yes |
Performance loss | smaller | larger | smaller | smaller |
Patch pack size | smaller | larger | general | general |
The development of transparent | yes | yes | no | no |
The complexity of the | The lower | The lower | complex | complex |
Gradle support | yes | no | no | no |
Interface documentation | rich | less | general | less |
Rom volume | Dalvik is larger | smaller | smaller | smaller |
The success rate | higher | The highest | general | general |
In summary:
- Dexposed can not support the whole platform, is not suitable for commercial products.
- As a native solution, AndFix first faces stability and compatibility problems. More importantly, it cannot achieve class replacement, which requires a large amount of additional development costs.
- The main problems of QZone solution are the performance problems of Dalvik caused by piling, and the rapid increase of patch package in order to solve the memory address problem under Art. Tinker hotfix not only supports class, So, and resource replacement, it also supports 2.x to 7.x platform. It requires no piling and the patch size is much smaller than other solutions. Tinker already runs on wechat’s hundreds of millions of Android devices.
The following project is a Demo based on the hotfix framework Tinker and summarizes some common problems.
tinker.gif
Project address github.com/xinghongfei…
Step 5. Architecture
Common architectures are: MVC, MVP, MVVM. The most commonly used architecture is MVC, and most applications now use MVP architecture, while MVVM is rarely used.
architucture.png
Google’s Android Data Binding (Android Data Binding
The following project is a very simple MVP architecture framework that simulates file downloads.
mvp.gif
Project address github.com/xinghongfei…
Step 6. Stay tuned
This is the hardest Step, so stay tuned
Conclusion: In order to collect and sort out these things, basically the whole National Day holiday time and energy spent on this, I hope it will be helpful to everyone, the future will continue to improve. If you like my article, you can click here Github to enter my tall, handsome and impossible foreign website to have a look, you can also click here to dig a blog platform I love very much, this will not point Jane book, 😄😄 welcome everyone to pay attention to ha, the follow-up will share more wonderful content. I wish good.