Tuesday, 22 September 2015

Android App Code Architecture

source: http://frank-zhu.github.io/android/2014/11/22/android-app-code-architecture/

Android App Code Architecture

Andrews APP architecture building codes

Android developers engaged for two years, always wanted to organize a get their usual code developed by other projects as infrastructure development, even before finishing off one, but because of their own short-board technology of the time, would have been a bit of code behind, so today is a relatively reasonable thing to rearrange the backup code, if you are interested in previous versions can click here ---> AndroidAppCodeFramework

The new code structure I will use the following open source libraries
  • Network traffic will use these open source libraries Retrofit OKHTTP
  • Network image loading Picasso / UIL
  • View注解 Butterknife
  • DB will use the local cache CursorLoader do with contentProvider
  • JSON parsing will use GSON
  • Notify update data may use EventBus or otto instead of broadcast
  • Message Tip AppMsg instead of the system Toast
  • Round picture CircleImageView

  • adapter ListView / GridView adapters are placed in this folder
  • The main APP app put some constants and configuration files
  • The main activity base and put the base class file fragment
  • dao major release database files
   Table database database 
   datahelper database data manipulation helper class, each table help derive a class action table
  • The main fragment file fragment put different pages
  • log APP help fight LOG class, you can switch off the output LOG to be removed directly by setting compiled Gradle function mode can also be confused.
  • model data model classes folder
  • network network operating mainly put files
    base class file storage controller callback HTTP requests main storage network control APP requested class action
  • ui main discharge activity file
  • utils some help classes are placed in this folder
  • view custom VIEW file
Under every file I have done a comment, a reference to the library also gives a link address, most use a little look WIKI should have no problem. Finally, the code download address, welcome Star and Fork github CODE downloads
By the way, in order to encode more quickly, you may spend some of the IDE plug-ins will be more rapid 1, ButterKnife Plugin , an IDEA plug-in, this should tie in with this open source library ButterKnife use, an annotation library, source As Dragger, by the Great God JakeWharton hand.
2, Parcelable , Andrews data serialization plug, not a last resort before recall will not use Parcelable to serialize, because he wrote it is too much trouble, with the introduction of a plug-in, my mother no longer have to worry about me write arcelable serialized data, and this is a loud noise with a loud noise was great
More plug-in tools can look me in this blog ----> Android handy and popular plug-ins and tools

No comments:

Post a Comment