This repository contains sample code. Its purpose being, to quickly demonstrate Android and software development in general, clean code, best practices, testing and all those other must know goodies.
The below listed skills are the main focus:
- Architectural Pattern
- Libraries
- Dagger 2
(A fast dependency injector for Android and Java)
- Butter Knife
(Bind Android views and callbacks to fields and methods)
- Retrolambda
(A gradle plugin for getting java lambda support in java 6, 7 and android)
- RxJava 2
(RxJava – Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM)
- Retrofit 2
(Type-safe HTTP client for Android and Java by Square, Inc.)
- Realm
(Realm is a mobile database: a replacement for SQLite & ORMs)
- Picasso
(A powerful image downloading and caching library for Android)
- Timber
(A logger with a small, extensible API which provides utility on top of Android's normal Log class)
- Dagger 2
- Android Support
- Swipe Refresh Layout
(The SwipeRefreshLayout should be used whenever the user can refresh the contents of a view via a vertical swipe gesture)
- Card View
(A FrameLayout with a rounded corner background and shadow)
- Recycler View
(A flexible view for providing a limited window into a large data set)
- Shared Element Transition
(Activity transitions in material design apps provide visual connections between different states through motion and transformations between common elements)
- Vector Drawables
(In Android 5.0 (API Level 21) and above, you can define vector drawables, which scale without losing definition)
- Swipe Refresh Layout
- Code Quality
- Android Lint
(The lint tool checks your Android project source files for potential bugs and optimization improvements for correctness, security, performance, usability, accessibility, and internationalization)
- Checkstyle
(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
(PMD is a source code analyzer)
- Findbugs
(A program which uses static analysis to look for bugs in Java code)
- Jacoco
(JaCoCo - Java Code Coverage Library)
- Android Lint
- Tests
- Espresso
(Espresso to write concise, beautiful, and reliable Android UI tests)
- JUnit
(A programmer-oriented testing framework for Java)
- Robolectric
(Android Unit Testing Framework)
- Mockito
(Most popular Mocking framework for unit tests written in Java)
- AssertJ
(AssertJ is a library providing easy to use rich typed assertions)
- Espresso
Use the below command to build the project in order to install it on an Android device for demonstration:
gradlew clean build -x check
Open an emulator or connect a physical device to experiment with the sample app, use the below command, which first uninstalls and then installs the sample app:
gradlew uninstallDebug | gradlew installDebug
Or faster yet and targeting a specific device (in our case an emulator)!
adb -s emulator-5554 uninstall io.petros.posts | adb -s emulator-5554 install app\build\outputs\apk\debug\app-debug.apk
Use this command in order to run the static code analysis for the project:
gradlew check -x test
Or even run the below commands to run a specific code quality tool in isolation:
gradlew lint
gradlew checkstyle
gradlew pmd
gradlew findbugs
Run the project unit tests using this command, Jacoco is included:
gradlew test
gradlew testDebugUnitTestCoverage
Open an emulator or connect a physical device to run the instrumentation tests using this command:
gradlew connectedAndroidTest
I also hope this project will help others to quick understand and grasp all the listed technologies...
ENJOY YOU