??xml version="1.0" encoding="utf-8" standalone="yes"?>在线观看亚洲一区,国产偷国产偷亚洲高清97cao,久久国产精品高清一区二区三区 http://www.aygfsteel.com/paulwong/category/51708.htmlzh-cnSat, 15 Jan 2022 13:31:34 GMTSat, 15 Jan 2022 13:31:34 GMT60Android Application Architecture 安卓APP架构[译]http://www.aygfsteel.com/paulwong/archive/2015/12/18/428718.htmlpaulwongpaulwongFri, 18 Dec 2015 05:07:00 GMThttp://www.aygfsteel.com/paulwong/archive/2015/12/18/428718.htmlhttp://www.aygfsteel.com/paulwong/comments/428718.htmlhttp://www.aygfsteel.com/paulwong/archive/2015/12/18/428718.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/428718.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/428718.html?/h2>

本文介绍?jin)文章作者从事了(jin)几年android应用的开发,l历2ơ架构变革,W一ơ集成了(jin)RxJavaW二ơ集成了(jin)MVPQƈRxJava与MVP完美l合Q实C(jin)低耦合Q代码简单,试方便的架构?/p>

其实我们在开发中也遇到过QAndroid入门门槛较低Q如果前期对APP规划不清晎ͼCoder们对未来变化把握不准Q技术架构经验不够强大,最l导致就是一个Activity几千行,里面写了(jin)大量的PrivateҎ(gu)Q拆成几个Fragment、封装出来几个类都是无法解决Q结果就是看Activity隑֏的要死,U结Q看?jin)不爽改也不是不改也不是Q严重媄(jing)响看的h的心(j)情。ƈ且怨天hq个是品h员规划App不好Q没有前L,Ҏ(gu)改去。。?/p>

q篇文章是使用新的l构解决该问题?/p>

安卓APP架构

Android Application Architecture

Our journey from standard Activities and AsyncTasks to a modern MVP-based architecture powered by RxJava.

q篇文章主要目的是讲q如何将传统的Activities ?AsyncTasks 模式向目前主的MVP架构基础的响应式~程框架q度?/p>

1*HrE2lljEfsCu1X_OUDfHYA

Different parts of a software codebase should be independent, yet perfectly work together like a well-oiled machine — photo by Chester Alvarez.

先畅享一下:(x)~~~如果松耦合架构Q分工明,然后完美的组合在一起工作是一个很吊的事情?br style="padding: 0px; margin: 0px;" />Q{个图片还要写明白谁拍的,版权意识真强Q?/p>

The Android dev ecosystem moves very quickly. Every week new tools are created, libraries are updated, blog posts are written and talks are given. If you go on holiday for a month, by the time you come back there will be a new version of the support library and/or Play Services.

最q几qAndroid的生态链变化非常q速,从底层的Android Api到应用层的各U开源的cd、工h新非常迅速。一不留就落后?jin)?/p>

I’ve been making Android apps with the ribot team for over three years. During this time, the architecture and technologies we’ve used to build Android apps have been continuously evolving. This article will take you through this journey by explaining our learnings, mistakes and the reasoning behind these architectural changes.

我在Ribot团队从事Android应用开发工作三q多Q伴随着公司技术的不断创新Q积累了(jin)很多l验、错误以?qing)在技术选型背后的故事?/p>

旧的应用架构

The old times
Back in 2012 our codebases used to follow a basic structure. We didn’t use any networking library and AsyncTasks were still our friends. The diagram below shows approximately how the architecture was.

2012q那个时候,我们的代码都是用的原生AndroidQ没有用Q何的|络h框架Q而是ZAsyncTasks书写?br style="padding: 0px; margin: 0px;" />1*TTtpcT4H80THBofnCtQ_L>The code was structured in two layers: the data layer that was in charge of retrieving/saving data from REST APIs and persistent data stores; and the view layer, whose responsibility was handling and displaying the data on the UI.
The APIProvider provides methods to enable Activities and Fragments to easily interact with the REST API. These methods use URLConnection and AsyncTasks to perform network calls in a separate thread and return the result to the Activities via callbacks.

代码分ؓ(f)两层QData与View,Data层主要是用来从API获取数据Q保存到持久化的db当中。View层主要就是把Data的数据显C到UI上。APIProvider提供Ҏ(gu)出来Q用于在Activity或者Fragment中方便的q行控制与交互。技术上,使用URLConnection与AsyncTasks实现?jin)一个异步的|络hq将l果q回到调用的回调Ҏ(gu)里面?/p>

In a similar way, the CacheProvider contains methods that retrieve and store data from SharedPreferences or a SQLite database. It also uses callbacks to pass the result back to the Activities.

相同的原理CacheProvider提供一pdҎ(gu)Q将SharedPreferences或者SQLite的数据取出来Qƈ且返回给到Activity

问题

The problems
The main issue with this approach was that the View layer had too many responsibilities. Imagine a simple common scenario where the application has to load a list of blog posts, cache them in a SQLite database and finally display them on a ListView. The Activity would have to do the following:

主要问题是View层有太多的篏赘,以一个博客列表ؓ(f)例来讲述Q比如博客需要显CZ个ListViewQ从SQLited数据QActivity需要做C下几点:(x)

  1. Call a method loadPosts(callback) in the APIProvider
  2. Wait for the APIProvider success callback and then call savePosts(callback) in the CacheProvider.
  3. Wait for the CacheProvider success callback and then display the posts on the ListView.
  4. Separately handle the two potential errors callback from the APIProvider and CacheProvider.
  1. 执行APIProvider里面的loadPosts的方法,里面传入回调参数内容?/li>
  2. {待loadPosts执行成功后,执行回调里面的CacheProvider中的savePostsҎ(gu)QsavePosts也要传入回调参数?/li>
  3. {待savePosts执行成功后,执行回调里面的方法刷新ListView
  4. 分别书写代码处理2 3 两步的错误回调内宏V?/li>

This is a very simple example. In a real case scenario the REST API will probably not return the data like the view needs it. Therefore, the Activity will have to somehow transform or filter the data before showing it. Another common case is when the loadPosts() method takes a parameter that needs to be fetched from somewhere else, for example an email address provided by the Play Services SDK. It’s likely that the SDK will return the email asynchronously using a callback, meaning that we now have three levels of nested callbacks. If we keep adding complexity, this approach will result into what is known as callback hell.

q还是一个比较简单的例子Q在一些真实的场景中,q程的API可能没有q回E序的必d|但是activity必须把数据处理完成之后才能显C结果。再一个例子就是如果loadPostsҎ(gu)需要借助一些其他地方的q回参数ӞcM用多U程d现同步请求,Z证数据正常请求,意味着必须做一个三层的回调Q如果再复杂一些,想理清楚q些回调?yu)是很蛋疼的事情?/p>

In summary:
Activities and Fragments become very large and difficult to maintain
Too many nested callbacks means the code is ugly and difficult to understand so painful to make changes or add new features.
Unit testing becomes challenging, if not impossible, because a lot of the logic lives within the Activities or Fragments that are arduous to unit test.

MQ回调多?jin)之后,Activity与Fragment?x)ؕ的要死,q且一般h无法直视?/p>

牛逼的新架构出来了(jin)

A new architecture driven by RxJava
We followed the previous approach for about two years. During that time, we made several improvements that slightly mitigated the problems described above. For example, we added several helper classes to reduce the code in Activities and Fragments and we started using Volley in the APIProvider. Despite these changes, our application code wasn’t yet test-friendly and the callback hell issue was still happening too often.

我们在蛋疼的架构中煎熬了(jin)2q_(d)当然也尝试过很多方式Q最l也只能是缓和一下ؕ的问题。我们在APIProvider使用?jin)VolleyQ代替了(jin)AsyncHttpClientQ但是其实是一个吊栗?/p>

It wasn’t until 2014 when we started reading about RxJava. After trying it on a few sample projects, we realised that this could finally be the solution to the nested callback problem. If you are not familiar with reactive programming you can read this introduction. In short, RxJava allows you to manage data via asynchronous streams and gives you many operators that you can apply to the stream in order to transform, filter or combine the data.

不到2014q我们就开始进行RxJava的预研,然后试?jin)一批简单的目Q感觉RxJava的方式是解决我们嵌套回调的终极解军_法。简单的_(d)RxJava允许你通过异步的方式理你的数据Qƈ且还可以通过操作W(OperatorsQ对Observable对象的变?/p>

Taking into account the pains we experienced in previous years, we started to think about how the architecture of a new app would look. So we came up with this.

我们用了(jin)几年的经验痛定思痛Q搞?jin)下面这么个东西Q新的APP的架构图

1*kCynNIa5PscRl41V2scosA-200

Similar to the first approach, this architecture can be separated into a data and view layer. The data layer contains the DataManager and a set of helpers. The view layer is formed by Android framework components like Fragments, Activities, ViewGroups, etc.

与第一U方法相|q个架构也是分ؓ(f)Data层与View层,Data层包含DataManager与一堆HelperQView层是包含Fragments, Activities, ViewGroups{?/p>

Helper classes (third column on diagram) have very specific responsibilities and implement them in a concise manner. For example, most projects have helpers for accessing REST APIs, reading data from databases or interacting with third party SDKs. Different applications will have a different number of helpers but the most common ones are:

Helper主要是集成第三方的类库,以便于在代码中几行代码就可以清晰的实现某个功能,比如hAPIQ访问数据库{,虽然不同的应用程序都有不同的cdQ但是他们无非就是以下这些内容:(x)

  • PreferencesHelper: reads and saves data in SharedPreferences.
  • DatabaseHelper: handles accessing SQLite databases.
  • Retrofit services: perform calls to REST APIs. We started using Retrofit instead of Volley because it provides support for RxJava. It’s also nicer to use.
  • 从SharedPreferences中读取或者写入数?/li>
  • dSQLite数据?/li>
  • cM与square的Retrofit服务Q也是Http Client,我们用Restrofit替代?jin)Volley因ؓ(f)他支持Rxjava,q且更吊?/li>

Most of the public methods inside helper classes will return RxJava Observables.
The DataManager is the brain of the architecture. It extensively uses RxJava operators to combine, filter and transform data retrieved from helper classes. The aim of the DataManager is to reduce the amount of work that Activities and Fragments have to do by providing data that is ready to display and won’t usually need any transformation.

RxJava最核心(j)的两个东西是ObservablesQ被观察者,事g源)(j)和SubscribersQ观察者)(j),在HelpercM的PublicҎ(gu)Q一般都?x)返回一个RxJava的Observables;DataManager是整个架构的大脑Q他大量的用Rxjava的operators对Helperq回来的数据q行的整合过滤、二ơ处理?/p>

The code below shows what a DataManager method would look like. This sample method works as follows:

下面用一个例子来说明DataManager是做什么的:

  1. Call the Retrofit service to load a list of blog posts from a REST API
  2. Save the posts in a local database for caching purposes using the DatabaseHelper.
  3. Filter the blog posts written today because those are the only ones the view layer wants to display.
  1. 调用Retrofit的服务,去请求一个博客列表的API
  2. 用DatabaseHelper保存q些数据到数据库
  3. qo(h)?gu)些BLOG哪些是今天写的,然后昄到UI界面上?/li>

Components in the view layer such as Activities or Fragments would simply call this method and subscribe to the returned Observable. Once the subscription finishes, the different Posts emitted by the Observable can be directly added to an Adapter in order to be displayed on a RecyclerView or similar.

Observables发出一pd事gQSubscribersQ例?Activities or FragmentsQ处理这些事?可以直接数据显C到一些可以回收、重用的View上面?br style="padding: 0px; margin: 0px;" />【BTW:如果一个Observerble没有M的的SubscriberQ那么这个Observable是不?x)发ZQ何事件的?/p>

The last element of this architecture is the event bus. The event bus allows us to broadcast events that happen in the data layer, so that multiple components in the view layer can subscribe to these events. For example, a signOut() method in the DataManager can post an event when the Observable completes so that multiple Activities that are subscribed to this event can change their UI to show a signed out state.

q个架构的另外一个模块是event busQevent bus可以让我们在Data层发出广播(不是Android的BroadcastQ然后不同的模块L册ƈ接收不同的广播事?/p>

Why was this approach better?
RxJava Observables and operators remove the need for having nested callbacks.
1*BIsOCzJnc-SSU8fPXTiP1A

Z么这个方式这么牛|是因为Observables与operators可以L那一堆必ȝ回调Ҏ(gu)

The DataManager takes over responsibilities that were previously part of the view layer. Hence, it makes Activities and Fragments more lightweight.
Moving code from Activities and Fragments to the DataManager and helpers means that writing unit tests becomes easier.

DataManager替代?jin)传l架构中很多代码Q从而得Activity与Fragment变得更加轻量U。ƈ且得单元测试变得更加简单?/p>

Clear separation of responsibilities and having the DataManager as the only point of interaction with the data layer, makes this architecture test-friendly. Helper classes or the DataManager can be easily mocked.

DataManager成ؓ(f)?jin)唯一的数据交互部分,q样清晰的架构得更方便q行代码自测?/p>

What problems did we still have?
For large and very complex projects the DataManager can become too bloated and difficult to maintain.
Although view layer components such as Activities and Fragments became more lightweight, they still have to handle a considerable amount of logic around managing RxJava subscriptions, analysing errors, etc.

我们q有什么问题?
- 如果对于非常庞大q且复杂的项目来_(d)DataManger也会(x)变得非常臃肿q且难以l护?br style="padding: 0px; margin: 0px;" />- 管Activity与Fragment已经变得更加轻量U,但是对于错误异常的处理还是要在subscriptions的地方去书写?/p>

一体化的MVP模式

Integrating Model View Presenter
In the past year, several architectural patterns such as MVP or MVVM have been gaining popularity within the Android community. After exploring these patterns on a sample project and article, we found that MVP could bring very valuable improvements to our existing approach. Because our current architecture was divided in two layers (view and data), adding MVP felt natural. We simply had to add a new layer of presenters and move part of the code from the view to presenters.

前几q开始,很多cMMVP与MVVM在Android的一些社区比较流行,l过研究之后Q我们发现MVP模式是对我们目前的方案最有h(hun)值的改动。我们的两层架构View-Data与MVP?Model-View架构天然融合Q理念一致。我们只需要增加一个presenters层,然后把之前在view实现的代码移C面就可以?jin)?br style="padding: 0px; margin: 0px;" />1*NonRJ0uzzN9o1ygT6J421g

The data layer remains as it was but it’s now called model to be more consistent with the name of the pattern.
Presenters are in charge of loading data from the model and calling the right method in the view when the result is ready. They subscribe to Observables returned by the data manager. Therefore, they have to handle things like schedulers and subscriptions. Moreover, they can analyse error codes or apply extra operations to the data stream if needed. For example, if we need to filter some data and this same filter is not likely to be reused anywhere else, it may make more sense to implement it in the presenter rather than in the data manager.

之前的Data层就是现在的MVP中的ModelQPresenter现在负责从Model中加载数据,加蝲完成后后再去调用左边的在Activity、ViewGroup中的Ҏ(gu)。Presenters的subscribeL收data manager中的Observablesq播出来的数据?br style="padding: 0px; margin: 0px;" />举例说明Q如果我们需要增加数据的qo(h)操作但是q不是所有地斚w需要的那种Q那可以在presenter里面写这些代码,而不用写在公qdatamanager里面?/p>

Below you can see what a public method in the presenter would look like. This code subscribes to the Observable returned by the dataManager.loadTodayPosts() method we defined in the previous section.

我们定义的dataManager.loadTodayPosts()?x)广播出数据l到对应的subscribes

The mMvpView is the view component that this presenter is assisting. Usually the MVP view is an instance of an Activity, Fragment or ViewGroup.

MVP的Viewq不是指的Android的ViewQ而是一个界面组件的的实例,例如Activity, Fragment Q?ViewGroup 在注册presenter的时候,需要把自己当前的实例传递进厅R?/p>

// Activity onCreate 中的代码D? if (presenter == null)         presenter = new Presenter1();         presenter.onTakeView(this);  

Like the previous architecture, the view layer contains standard framework components like ViewGroups, Fragments or Activities. The main difference is that these components don’t subscribe directly to Observables. They instead implement an MvpView interface and provide a list of concise methods such as showError() or showProgressIndicator(). The view components are also in charge of handling user interactions such as click events and act accordingly by calling the right method in the presenter. For example, if we have a button that loads the list of posts, our Activity would call presenter.loadTodayPosts() from the onClick listener.

q个架构与上一个架构不同的是,ViewLayer 也就是Activityq些Q不?x)直接去订阅接收Observables发出的这些事件。而是只在Activity实现几个单的昄错误、显C度的Ҏ(gu)Q用接口interface来规范统一Q,然后把当前实例以参数形式传递给到对应事件的PresenterQ由PresenterL行这些显C错误、显C度的Ҏ(gu)?br style="padding: 0px; margin: 0px;" />当然对于用户交互部分的按钮点M件还是要在Activity中进行处理?/p>

If you want to see a full working sample of this MVP-based architecture, you can check out our Android Boilerplate project on GitHub. You can also read more about it in the ribot’s architecture guidelines.

关于MVP的文章可以自行百度一下,MVP Android 关键?/p>

Why is this approach better?

Z么这个又最?/strong>

  • Activities and Fragments become very lightweight. Their only responsibilities are to set up/update the UI and handle user events. Therefore, they become easier to maintain.
  • We can now easily write unit tests for the presenters by mocking the view layer. Before, this code was part of the view layer so we couldn’t unit test it. The whole architecture becomes very test-friendly.
  • If the data manager is becoming bloated, we can mitigate this problem by moving some code to the presenters.
  • Activity与Fragment代码量大大降低,逻辑代码全部都丢l了(jin)Presenter,l果是Activity只需要负责UI交互的按钮等代码?/li>
  • 对于Presenter可以写单独的单元试代码Q只需要对Presenter提供的方法测试即?/li>
  • 如果DataManager变得臃肿庞大?jin),我们可以分离q些代码到各自的Presenter中去?/li>

What problems do we still have?
现在q有遗留什么问?/strong>

Having a single data manager can still be an issue when the codebase becomes very large and complex. We haven’t reached the point where this is a real problem but we are aware that it could happen.

只有一个DataManager仍旧是一个问题,其是当代码目比较庞大的时候,当然我们q没有到达这个庞大的地步Q尽我们知道这个将来某天会(x)发生?/p>

It’s important to mention that this is not the perfect architecture. In fact, it’d be naive to think there is a unique and perfect one that will solve all your problems forever. The Android ecosystem will keep evolving at a fast pace and we have to keep up by exploring, reading and experimenting so that we can find better ways to continue building excellent Android apps.

如果x个完的架构解决你所有问题是不可能的。TMD Android的整个生态圈变化太快Q又TM的不标准Q就D我们不断的去探烦(ch)探烦(ch)。。。以致于L到更吊的Ҏ(gu)dAndroid apps?/p>

I hope you enjoyed this article and you found it useful. If so, don’t forget to click the recommend button. Also, I’d love to hear your thoughts about our latest approach.

希望M(jin)之后Ҏ(gu)们的最新解x案能有些x?/p>

【本文翻译的目的是在闲暇旉Q研I新技术,用通俗技术语a写给自己看,便于日后方便查阅为目?br style="padding: 0px; margin: 0px;" />原文Q?a style="padding: 0px; margin: 0px; color: #ff8373; outline: 0px; font-size: 12px;">https://medium.com/ribot-labs/android-application-architecture-8b6e34acda65
MVP介绍Q?a style="padding: 0px; margin: 0px; color: #ff8373; outline: 0px; font-size: 12px;">http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2015/0425/2782.html
RxAndroid:https://github.com/ReactiveX/RxAndroid
Eventbus:https://github.com/greenrobot/EventBus



paulwong 2015-12-18 13:07 发表评论
]]>
六款值得推荐的androidQ安卓)(j)开源框架简介【{?/title><link>http://www.aygfsteel.com/paulwong/archive/2014/07/09/415632.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Wed, 09 Jul 2014 08:56:00 GMT</pubDate><guid>http://www.aygfsteel.com/paulwong/archive/2014/07/09/415632.html</guid><wfw:comment>http://www.aygfsteel.com/paulwong/comments/415632.html</wfw:comment><comments>http://www.aygfsteel.com/paulwong/archive/2014/07/09/415632.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/paulwong/comments/commentRss/415632.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/paulwong/services/trackbacks/415632.html</trackback:ping><description><![CDATA[<span style="color: #0000ff;">1、volley </span><br /><br />目地址 https://github.com/smanikandan14/Volley-demo<br /> (1) JSONQ图像等的异步下载;<br /> (2) |络h的排序(schedulingQ?br /> (3) |络h的优先处理<br /> (4) ~存<br /> (5) 多别取消请?br /> (6) 和Activity和生命周期的联动QActivityl束时同时取消所有网l请求)(j)<br /><br /><br /><span style="color: #0000ff;">2、android-async-http </span><br /><br />目地址Qhttps://github.com/loopj/android-async-http<br />文档介绍Qhttp://loopj.com/android-async-http/ <br /> (1) 在匿名回调中处理hl果<br /> (2) 在UIU程外进行httph<br /> (3) 文g断点上传<br /> (4) 重试<br /> (5) 默认gzip压羃<br /> (6) 支持解析成Json格式<br /> (7) 可将Cookies持久化到SharedPreferences<br /><br /><br /><span style="color: #0000ff;">3、Afinal框架</span><br /><br />目地址Qhttps://github.com/yangfuhai/afinal<br />主要有四大模块:(x)<br /> (1) 数据库模块:(x)android中的orm框架Q用了(jin)U程池对sqliteq行操作?br /> (2) 注解模块Qandroid中的ioc框架Q完全注解方式就可以q行UIl定和事件绑定。无需findViewById和setClickListener{?br /> (3) |络模块Q通过httpclientq行装http数据hQ支持ajax方式加蝲Q支持下载、上传文件功能?br /> (4) 囄~存模块Q通过FinalBitmapQimageview加蝲bitmap的时候无需考虑bitmap加蝲q程中出现的oom和android容器快速滑动时候出现的囄错位{现象?br /> FinalBitmap可以配置U程加蝲U程数量Q缓存大,~存路径Q加载显C动ȝ。FinalBitmap的内存管理用lru法Q?br /> 没有使用弱引用(android2.3以后google已经不徏议用弱引用Qandroid2.3后强行回收Y引用和弱引用Q详情查看android官方文档Q,<br /> 更好的管理bitmap内存。FinalBitmap可以自定义下载器Q用来扩展其他协议显C网l图片,比如ftp{。同时可以自定义bitmap昄器,<br /> 在imageview昄囄的时候播攑֊ȝQ默认是渐变动画昄Q?br /><br /><br /><span style="color: #0000ff;">4、xUtils框架</span><br /><br />目地址Qhttps://github.com/wyouflf/xUtils<br />主要有四大模块:(x)<br /> (1) 数据库模块:(x)android中的orm框架Q一行代码就可以q行增删Ҏ(gu)Q?br /> 支持事务Q默认关闭;<br /> 可通过注解自定义表名,列名Q外键,唯一性约束,NOT NULLU束QCHECKU束{(需要؜淆的时候请注解表名和列名)(j)Q?br /> 支持l定外键Q保存实体时外键兌实体自动保存或更斎ͼ<br /> 自动加蝲外键兌实体Q支持g时加载;<br /> 支持铑ּ表达查询Q更直观的查询语义,参考下面的介绍或sample中的例子? <br /> (2) 注解模块Qandroid中的ioc框架Q完全注解方式就可以q行UIQ资源和事gl定Q?br /> 新的事gl定方式Q用؜淆工h؜淆后仍可正常工作Q?br /> 目前支持常用?0U事件绑定,参见ViewCommonEventListenercd包com.lidroid.xutils.view.annotation.event?br /> (3) |络模块Q支持同步,异步方式的请求;<br /> 支持大文件上传,上传大文件不?x)oomQ?br /> 支持GETQPOSTQPUTQMOVEQCOPYQDELETEQHEADQOPTIONSQTRACEQCONNECThQ?br /> 下蝲支持301/302重定向,支持讄是否Ҏ(gu)Content-Disposition重命名下载的文gQ?br /> q回文本内容的请?默认只启用了(jin)GETh)支持~存Q可讄默认q期旉和针对当前请求的q期旉? <br /> (4) 囄~存模块Q加载bitmap的时候无需考虑bitmap加蝲q程中出现的oom和android容器快速滑动时候出现的囄错位{现象;<br /> 支持加蝲|络囄和本地图片;<br /> 内存理使用lru法Q更好的理bitmap内存Q?br /> 可配|线E加载线E数量,~存大小Q缓存\径,加蝲昄动画{?..<br /><br /><br /><span style="color: #0000ff;">5、ThinkAndroid</span><br /><br />目地址Qhttps://github.com/white-cat/ThinkAndroid<br />主要有以下模块:(x)<br /> (1) MVC模块Q实现视图与模型的分R?br /> (2) ioc模块Qandroid中的ioc模块Q完全注解方式就可以q行UIl定、res中的资源的读取、以?qing)对象的初始化?<br /> (3) 数据库模块:(x)android中的orm框架Q用了(jin)U程池对sqliteq行操作? <br /> (4) http模块Q通过httpclientq行装http数据hQ支持异步及(qing)同步方式加蝲?br /> (5) ~存模块Q通过单的配置?qing)设计可以很好的实现~存Q对~存可以随意的配|?br /> (6) 囄~存模块Qimageview加蝲囄的时候无需考虑囄加蝲q程中出现的oom和android容器快速滑动时候出现的囄错位{现象?br /> (7) 配置器模块:(x)可以对简易的实现配对配置的操作,目前配置文g可以支持Preference、Properties寚w|进行存取?br /> (8) 日志打印模块Q可以较快的L的是实现日志打印Q支持日志打印的扩展Q目前支持对sdcard写入本地打印、以?qing)控制台打?br /> (9) 下蝲器模?可以单的实现多线E下载、后C载、断点箋传、对下蝲q行控制、如开始、暂停、删除等{?br /> (10) |络状态检模块:(x)当网l状态改变时Q对其进行检<br /><br /><br /><span style="color: #0000ff;">6、LoonAndroid </span><br /><br />目地址Qhttps://github.com/gdpancheng/LoonAndroid<br />主要有以下模块:(x)<br /> (1) 自动注入框架Q只需要承框架内的application既可Q?br /> (2) 囄加蝲框架Q多重缓存,自动回收Q最大限度保证内存的安全性)(j)<br /> (3) |络h模块Q承了(jin)基本上现在所有的httphQ?br /> (4) eventbusQ集成一个开源的框架Q?br /> (5) 验证框架Q集成开源框Ӟ(j)<br /> (6) json解析Q支持解析成集合或者对象)(j)<br /> (7) 数据库(不知道是哪位写的 忘记?jin)?j)<br /> (8) 多线E断点下载(自动判断是否支持多线E,判断是否是重定向Q?br /> (9) 自动更新模块<br /> (10) 一pd工具c?br /><br />其中?volley Q?3 q有研究q,扩展性非常好Q个人比较喜Ƣ的风格。其他如 android-async-http、Afinal 也相当不错?img src ="http://www.aygfsteel.com/paulwong/aggbug/415632.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/paulwong/" target="_blank">paulwong</a> 2014-07-09 16:56 <a href="http://www.aygfsteel.com/paulwong/archive/2014/07/09/415632.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Android开源项目分cL?/title><link>http://www.aygfsteel.com/paulwong/archive/2014/01/09/408723.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Thu, 09 Jan 2014 03:03:00 GMT</pubDate><guid>http://www.aygfsteel.com/paulwong/archive/2014/01/09/408723.html</guid><wfw:comment>http://www.aygfsteel.com/paulwong/comments/408723.html</wfw:comment><comments>http://www.aygfsteel.com/paulwong/archive/2014/01/09/408723.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/paulwong/comments/commentRss/408723.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/paulwong/services/trackbacks/408723.html</trackback:ping><description><![CDATA[<p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #efefef;"><span style="font-size: 18px;">分类整理?50个比较好的Android开源项目,已汇d<a target="_blank" style="color: #006699;">AndroidOpenProject@Github</a>Q欢qStar和Fork^_*</span></p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #efefef;"> </p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #efefef;"><span style="font-size: 18px;">目前包括Q?/span></p><p style="margin: 0px; padding: 0px; font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25.1875px; background-color: #efefef;"><a style="color: #4183c4; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;">Android开源项目第一?#8212;—个性化控g(View)?/a><br style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;" /><em style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;">  包括ListView、ActionBar、Menu、ViewPager、Gallery、GridView、ImageView、ProgressBar{等</em><br style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;" /><a style="color: #4183c4; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;">Android开源项目第二篇——工具库篇</a><br style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;" /><em style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;">  包括依赖注入框架、图片缓存、网l相兟뀁数据库ORM建模、Android公共库、高版本向低版本兼容库、多媒体{等</em><br style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;" /><a style="color: #4183c4; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;">Android开源项目第三篇——优秀目?/a><br style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;" /><em style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;">  比较有意思的完整的Android目</em><br style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;" /><a style="color: #4183c4; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;">Android开源项目第四篇——开发及(qing)试工具?/a><br style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;" /><em style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;">  包括开发自、自动化试、编译打包相兛_?/em><br style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;" /><a style="color: #4183c4; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;">Android开源项目第五篇——优秀个h和团体篇</a><br style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;" /><em style="color: #777777; font-family: Helvetica, arial, freesans, clean, sans-serif; font-size: 15px; line-height: 25px;">  乐于分nq且有一些很不错的开源项目的个h和组l,包括JakeWharton、Chris Banes、Koushik Dutta{大?/em></p><img src ="http://www.aygfsteel.com/paulwong/aggbug/408723.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/paulwong/" target="_blank">paulwong</a> 2014-01-09 11:03 <a href="http://www.aygfsteel.com/paulwong/archive/2014/01/09/408723.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ud讑֤抓包Ҏ(gu)http://www.aygfsteel.com/paulwong/archive/2013/12/30/408195.htmlpaulwongpaulwongMon, 30 Dec 2013 03:23:00 GMThttp://www.aygfsteel.com/paulwong/archive/2013/12/30/408195.htmlhttp://www.aygfsteel.com/paulwong/comments/408195.htmlhttp://www.aygfsteel.com/paulwong/archive/2013/12/30/408195.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/408195.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/408195.htmlios抓包Ҏ(gu)Q?a target="_blank">http://www.99css.com/archives/1272


android抓包Ҏ(gu)Q?a target="_blank">http://www.cnblogs.com/xyzlmn/p/3168065.html

paulwong 2013-12-30 11:23 发表评论
]]>
ANDROID APPS DATA资源http://www.aygfsteel.com/paulwong/archive/2013/06/25/400952.htmlpaulwongpaulwongTue, 25 Jun 2013 14:11:00 GMThttp://www.aygfsteel.com/paulwong/archive/2013/06/25/400952.htmlhttp://www.aygfsteel.com/paulwong/comments/400952.htmlhttp://www.aygfsteel.com/paulwong/archive/2013/06/25/400952.html#Feedback0http://www.aygfsteel.com/paulwong/comments/commentRss/400952.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/400952.htmlhttp://stackoverflow.com/questions/10272155/getting-data-from-android-play-store


https://developer.android.com/distribute/googleplay/promote/linking.html


http://www.scriptrr.com/data-scrapping-get-android-google-play-app-info/

paulwong 2013-06-25 22:11 发表评论
]]>
ANDROID APP ?WEB APP的比?/title><link>http://www.aygfsteel.com/paulwong/archive/2013/05/26/399764.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Sat, 25 May 2013 16:59:00 GMT</pubDate><guid>http://www.aygfsteel.com/paulwong/archive/2013/05/26/399764.html</guid><wfw:comment>http://www.aygfsteel.com/paulwong/comments/399764.html</wfw:comment><comments>http://www.aygfsteel.com/paulwong/archive/2013/05/26/399764.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/paulwong/comments/commentRss/399764.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/paulwong/services/trackbacks/399764.html</trackback:ping><description><![CDATA[ANDROID APP ?WEB APP有相g处,都是需要在容器内运行,都可以对事gq行响应? <div><br /> </div> <div>WEB APP的核?j)组件是SERVLETQ这是对游览器事件进行响应的一个类Q事件有GET/POST{事Ӟ不同的URL对应不同的SERVLET?/div> <div>如果要输Z同的内容Q则输出不同的HTML卛_?br />WEB APP的配|文件是WEB.XMLQ当容器启动Ӟ?x)从q读取有多少个SERVLET。当览器发q来不同的URLhӞ?x)从中选择相应的SERVLET执行?/div> <div><br /> </div> <div>ANDROID APP的核?j)组件是ACTIVITYQ这是一个对pȝ事gq行响应的一个类Q事件有启动事gQ菜单点M件等Q点M同的地方对应不同的ACTIVITY?/div> <div>如果要输Z同的内容Q则输出不同的VIEW卛_?br />ANDROID APP的配|文件是MAINFRE.XMLQ当应用被部|到pȝӞpȝ?x)从q读取有多少个ACTIVITY。当不同的事件发生时Q系l会(x)?x)从中选择相应的ACTIVITY执行?/div><img src ="http://www.aygfsteel.com/paulwong/aggbug/399764.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/paulwong/" target="_blank">paulwong</a> 2013-05-26 00:59 <a href="http://www.aygfsteel.com/paulwong/archive/2013/05/26/399764.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>演化理解 Android 异步加蝲囄http://www.aygfsteel.com/paulwong/archive/2012/05/15/378229.htmlpaulwongpaulwongTue, 15 May 2012 14:27:00 GMThttp://www.aygfsteel.com/paulwong/archive/2012/05/15/378229.htmlhttp://www.aygfsteel.com/paulwong/comments/378229.htmlhttp://www.aygfsteel.com/paulwong/archive/2012/05/15/378229.html#Feedback1http://www.aygfsteel.com/paulwong/comments/commentRss/378229.htmlhttp://www.aygfsteel.com/paulwong/services/trackbacks/378229.html阅读全文

paulwong 2012-05-15 22:27 发表评论
]]>
վ֩ģ壺 | | °Ͷ| | | | | ɽ| | ±| | ζ| ǰ| ʡ| | | | | | Т| | | | Ѱ| °| | «| ʩ| ²| ɽ| | ϲ| | | | żҽ| | ػ| | | ˮ|