Flirten Architecture 2.0 for Android

Build System

We use gradle as the build system.

crash reporting

We use Crashlytics as the crash reporting solution.

Push Notifications

We use Google Cloud Messaging for Android (GCM) to implement push notifications.

3rd part library

volley:Volley is an HTTP library that makes networking for Android apps easier and most importantly, faster.

android-priority-jobqueue:Priority Job Queue is an implementation of a Job Queue specifically written for Android to easily schedule jobs (tasks) that run in the background, improving UX and application stability.

eventbus:EventBus is publish/subscribe event bus optimized for Android.

butterknife:Field and method binding for Android views which uses annotation processing to generate boilerplate code for you.

picasso:A powerful image downloading and caching library for Android.

smack-android:An Open Source XMPP Client Library written in Java for JVMs and Android

facebook-android-sdk:Helps you build engaging social apps and get more installs.

greendao:greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.

logger:Simple, pretty and powerful logger for android

adjust:Analyze user behaviour in real time

stetho:A debug bridge for Android applications

blockcanary:A transparent ui-block detection library for Android

leakcanary:A memory leak detection library for Android and Java.

Architecture diagram

see

Code exmaple

communicate with server

We use APIAgent to communicate with the endpoint.
for example like how to get the access_token:
agent.getAccessToken(userName, password, new Response.Listener<IWAccessToken>() { @Override public void onResponse(IWAccessToken response) { EventBus.getDefault().post(new IWLoginSuccessEvent()); } }, getDefaultErrorlistener());
You should implement the callback:
Response.Listener
Response.ErrorListener
We use eventbus to notify the UI thread to do the responding.
public void onEvent(IWLoginSuccessEvent event) { Intent intent = new Intent(getSelf(), MainActivity.class); startActivity(intent); }
The onEvent method should be defined in an Activity or a Fragment.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容