Skip to content

Trantect/android_framework_demo

Repository files navigation

android_framework_demo

===================================

Dependencies

We use some third-party libraries: (reference)

Dependency injection framework

Note:

  • Do NOT ignore the pattern

  • Do NOT make every class use the pattern

  • Do NOT store dependencies as static fields

      Avoid dependency injection frameworks
    
      Using a dependency injection framework such as Guice or RoboGuice may be attractive because they can simplify the code you write and provide an adaptive environment that's useful for testing and other configuration changes. However, these frameworks tend to perform a lot of process initialization by scanning your code for annotations, which can require significant amounts of your code to be mapped into RAM even though you don't need it. These mapped pages are allocated into clean memory so Android can drop them, but that won't happen until the pages have been left in memory for a long period of time.
    

http://developer.android.com/training/articles/memory.html#DependencyInjection

Network

Build

We use gradle to build project:

  • use terminal and change current directory to project root directory
  • run ./gradlew clean to clean project
  • run ./gradlew assemble to assemble debug and release builds
  • run ./gradlew assembleDebug to assemble debug build
  • run ./gradlew assembleRelease to assemble release build

Then you will see apk files in folder ./build/outputs/apk/

Tests

Unit Tests (small-scope and low-level)

Integration and UI Tests (large-scope and interacted)

Code Coverage

Since gradle 10.0.+, the code coverage feature of Jacoco is integrated with gradle build tool. Please refer to build.gradle file for config details.

  • run command ./gradlew clean connectedCheck to run Android tests and code coverage.
  • The reports locate in app/build/outputs/reports

Jenkins

Configure Steps

  • Create a new item, named "android_fragement_demo":

      Figure: CreatItem.png
    
  • Enter android_fragment_demo project, then click "Configure"

  • Modify the configure page according to the pictures:

      Figure: Project_and_Source.png -> Build_Triggers.png -> Build_Environment.png -> Build.png -> Post-buildActions.png
    

Output

	Figure: Output_screen.png

Jenkins

Screenshots of Jenkins jobs for this project can be found in folder JenkinsScreenShot.

Thanks to

About

A live demo of Android project with various tools

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published