Android project framework upgrade early adopters OkHttp


 This article is from http://blog.csdn.net/liuxian13183/  , and the reference must be indicated!


The topic of architecture is relatively large; from the perspective of organizational structure, the CEO is the architect of a company, who divides the company into sales department, marketing department, technology department, administration department, finance department, customer service department, etc., each department performs unique functions And cooperate with each other to finally achieve the effective output of "product"; the same is true for technical architecture.

The main purpose of the project architecture is to decouple and develop flexibly, so that the backend becomes the bottleneck of the product instead of the client. All businesses
can be "hot loaded"; large projects require plug-in development, which must be Reduce dependencies, so that compilation and execution will be faster, and the user experience will be better.

question:

1. How to ensure that the http request gets the corresponding cached data from the App instead of requesting the server?

The client and the server negotiate the time limit of the Get request, which can effectively solve some concurrency problems.

Android project framework upgrade early adopters OkHttp

2. How to keep the application alive?

How to keep the application alive in the eighth lecture of Android elementary

3. How to optimize power and memory?

      Android Advanced Twelve Lectures on Memory, Power, Caton, Traffic

4. Security issues: Customized execution of specific operations, directory whitelisting, grayscale publishing, etc. to safely load applications.

5. Cache problem: LruCache-Least Recently Used Cache, clear the least recently used cache.

Principle: Design the cache size, use LinkedList to access data; use the number +1 when getting, and use the number +1 when putting, and monitor whether the memory is out of bounds;

If it is out of bounds, start an infinite loop, clear the least used cache (found by eldest of linkedHashMap), and then bread; continue.

Android Advanced Thirteen Lectures Security Solutions

Grayscale release:

It is mainly A/B testing, which is divided into functional modules, regions, and user ratios. At the same time, the test can be stopped in time to prevent accidents.

Avoid affecting the online user experience.

Next, compare the experiments and use the data to determine which set of programs to use.


What are the main tasks of the architecture?

0. Construct design patterns, MVC, MVP or MVVM, data access, network tools, loading process, etc.

1. Design basic functional modules

就像生活必备水电煤、米油盐一样,有这些日子才能过起来,项目也一样。设计模式、组件通信、加载过程、网络框架、图片框架、线程池管理、UI框架、必要组件、必要功能、基础组件等均在初期需要制订。

2、设计基本功能模块

细化项目框架和组件,以及样式,设计项目的核心功能,分配功能模块,灵活设计可插拔模块

3、减少业务耦合度

AOP思想,面向切面编程,即专注处理自身模块,通过scheme来告诉外界自己的功能,通过Filter来过滤可以处理细化的信息。

Android中可以使用RxBus和自定义路由来实现。

Otto据说比EventBus、handler、BroadcastReceive和interface更简单,回头要研究一下。

将订阅者及内部的方法以键值对的形式存入RxBusFactory,事件源发送事件根据消息类型交由不同的订阅者处理。

4、保持调用灵活性

接口和类要全面适配,如参数类型、参数数量、API版本、so库支持等


5、良好的编译工具和打包工具

编译工具:Android最佳编译工具介绍

打包工具:Ant、Gradle、Python三种打包方式的介绍

Gradle加速编译:http://droidyue.com/blog/2017/04/16/speedup-gradle-building/index.html



Lint用于找出应用中的异常以及不规范的操作

http://tech.meituan.com/android_custom_lint.html

https://github.com/shwenzhang/AndResGuard

6、项目管理工具,建议用Git,跟Svn的最大区别在于:分布式管理,每个人的电脑都是服务器。

Git教程及问题解析

架构师的修养:阿里中间件需要怎样的架构师?

Live地址:知乎

翻墙服务搭建:https://www.diycode.cc/topics/738

FindViewById的快速工具:http://www.cnblogs.com/klcf0220/p/5924440.html

谷歌开源检查应用错误工具:Error-prone

markdownpad:

先安这个: http://markdownpad.com/download/awesomium_v1.6.6_sdk_win.exe

再安这个:http://markdownpad.com/

MVVM:http://download.csdn.net/detail/liuxian13183/9884386


网站使用www.example.com和example.com的区别:

后者携带该网站所有cookie信息,不够安全;一般通过301设置,将后者跳到前者。一方面有利于统计访问(对SEO无影响),另一方面不会给用户造成困扰(后者未作配置,无法访问)。

Fiddler使用:保证手机网络和电脑网络处于同一个路由下面,同一个IP段。


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326035972&siteId=291194637