ที่เก็บนี้มีรหัสตัวอย่าง จุดประสงค์ของมันคือการแสดงให้เห็นถึงการพัฒนา 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
หรือเร็วกว่านี้และกำหนดเป้าหมายอุปกรณ์เฉพาะ (ในกรณีของเรา emulator)!
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
ฉันหวังว่าโครงการนี้จะช่วยให้ผู้อื่นเข้าใจอย่างรวดเร็วและเข้าใจเทคโนโลยีที่ระบุไว้ทั้งหมด ...
สนุกกับคุณ