An intelligent personal assistant for Android that helps users build new, small healthy habits into an overall happier life.
- Support libraries
- RecyclerViews and CardViews
- RxJava -
- RxAndroid -
- Retrofit 2 -
- Dagger 2 -
- SqlBrite -
- Butterknife -
- Timber -
- Glide -
- AutoValue -
- AutoValueParcel (extension) -
- AutoValueGson (extension) -
- Espresso - Functional tests
- Robolectric -
- Mockito -
- Checkstyle - Code analysis
- PMD - Code analysis
- Findbugs - Code analysis
- Ribot Boilerplate - Boilerplate code
- JDK 1.8
- Android SDK.
- Android N (API 24) .
- Latest Android SDK Tools and build tools.
- In app/build.gradle add the signing config to enable release versions.
- Add Fabric API key and secret to fabric.properties and uncomment Fabric plugin set up in app/build.gradle
This project follows ribot's Android architecture guidelines that are based on MVP (Model View Presenter). Read more about them here.
Imagine you have to implement a sign in screen.
- Create a new package under
ui
calledsignin
- Create an new Activity called
ActivitySignIn
. You could also use a Fragment. - Define the view interface that your Activity is going to implement. Create a new interface called
SignInMvpView
that extendsMvpView
. Add the methods that you think will be necessary, e.g.showSignInSuccessful()
- Create a
SignInPresenter
class that extendsBasePresenter<SignInMvpView>
- Implement the methods in
SignInPresenter
that your Activity requires to perform the necessary actions, e.g.signIn(String email)
. Once the sign in action finishes you should callgetMvpView().showSignInSuccessful()
. - Create a
SignInPresenterTest
and write unit tests forsignIn(email)
. Remember to mock theSignInMvpView
and also theDataManager
. - Make your
ActivitySignIn
implementSignInMvpView
and implement the required methods likeshowSignInSuccessful()
- In your activity, inject a new instance of
SignInPresenter
and callpresenter.attachView(this)
fromonCreate
andpresenter.detachView()
fromonDestroy()
. Also, set up a click listener in your button that callspresenter.signIn(email)
. - Update proguard-rules.pro to keep models (see TODO in file) and add extra rules to file if needed.
This project integrates a combination of unit tests, functional test and code analysis tools.
To run unit tests on your machine:
./gradlew test
To run functional tests on connected devices:
./gradlew connectedAndroidTest
Note: For Android Studio to use syntax highlighting for Automated tests and Unit tests you must switch the Build Variant to the desired mode.
The following code analysis tools are set up on this project:
- PMD: It finds common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and so forth. See this project's PMD ruleset.
./gradlew pmd
- Findbugs: This tool uses static analysis to find bugs in Java code. Unlike PMD, it uses compiled Java bytecode instead of source code.
./gradlew findbugs
- Checkstyle: It ensures that the code style follows our Android code guidelines. See our checkstyle config file.
./gradlew checkstyle
To ensure that your code is valid and stable use check:
./gradlew check
This will run all the code analysis tools and unit tests in the following order:
The project can be distributed using either Crashlytics or the Google Play Store.
We use the Gradle Play Publisher plugin. Once set up correctly, you will be able to push new builds to the Alpha, Beta or production channels like this
./gradlew publishApkRelease
Read plugin documentation for more info.
You can also use Fabric's Crashlytics for distributing beta releases. Remember to add your fabric
account details to app/src/fabric.properties
.
To upload a release build to Crashlytics run:
./gradlew assembleRelease crashlyticsUploadDistributionRelease
Please read CONTRIBUTING.md for details on our CODE_OF_CONDUCT.md, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Vikash Kothary - Main Developer - Github
See also the list of contributors who participated in this project.
This project is licensed under the Apache 2.0 License - see the LICENSE.md file for details
Copyright 2017 Vikash Kothary
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
- Abraham Maslow