===================================
We use some third-party libraries: (reference)
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
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/
- Android Instrumentation API
- Robotium and code
- UI Automator and how-to
- Espresso
- Calabash-android (its underlying implementation uses Robotium)
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
-
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
Figure: Output_screen.png
Screenshots of Jenkins jobs for this project can be found in folder JenkinsScreenShot.
- guoyunsky for his 演示Markdown的各种语法