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() { @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.

你可能感兴趣的:(Flirten Architecture 2.0 for Android)