sample code posts
1.0.0
此存儲庫包含示例代碼。其目的是快速演示一般而言的Android和軟件開發,即乾淨的代碼,最佳實踐,測試以及所有其他必須知道的東西。
以下列出的技能是主要重點:
(Canonical code only, without any libraries)(Helper MVP library)(A fast dependency injector for Android and Java)(Bind Android views and callbacks to fields and methods)(A gradle plugin for getting java lambda support in java 6, 7 and android)(RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM)(Type-safe HTTP client for Android and Java by Square, Inc.)(Realm is a mobile database: a replacement for SQLite & ORMs)(A powerful image downloading and caching library for Android)(A logger with a small, extensible API which provides utility on top of Android's normal Log class)(The SwipeRefreshLayout should be used whenever the user can refresh the contents of a view via a vertical swipe gesture)(A FrameLayout with a rounded corner background and shadow)(A flexible view for providing a limited window into a large data set)(Activity transitions in material design apps provide visual connections between different states through motion and transformations between common elements)(In Android 5.0 (API Level 21) and above, you can define vector drawables, which scale without losing definition)(The lint tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization)(Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. By default it supports the Google Java Style Guide and Sun Code Conventions, but is highly configurable. It can be invoked with an ANT task and a command line program.)(PMD is a source code analyzer)(A program which uses static analysis to look for bugs in Java code)(JaCoCo - Java Code Coverage Library)(Espresso to write concise, beautiful, and reliable Android UI tests)(A programmer-oriented testing framework for Java)(Android Unit Testing Framework)(Most popular Mocking framework for unit tests written in Java)(AssertJ is a library providing easy to use rich typed assertions)使用以下命令來構建項目,以便在Android設備上安裝它以進行演示:
gradlew clean build -x check
打開仿真器或連接物理設備以實驗示例應用程序,使用以下命令,該命令首先卸載,然後安裝示例應用程序:
gradlew uninstallDebug | gradlew installDebug
或更快地瞄準特定設備(在我們的情況下是模擬器)!
adb -s emulator-5554 uninstall io.petros.posts | adb -s emulator-5554 install appbuildoutputsapkdebugapp-debug.apk

使用此命令來運行項目的靜態代碼分析:
gradlew check -x test
甚至運行以下命令以隔離運行特定的代碼質量工具:
gradlew lint
gradlew checkstyle
gradlew pmd
gradlew findbugs
使用此命令運行項目單元測試,包括jacoco:
gradlew test
gradlew testDebugUnitTestCoverage
打開模擬器或連接物理設備以使用此命令運行儀器測試:
gradlew connectedAndroidTest
我也希望這個項目能幫助其他人快速理解並掌握所有列出的技術...
享受你