rootstrap / android-base

Rootstrap Android Base project
https://rootstrap.com
40 stars 6 forks source link
android base-project boilerplate kotlin kotlin-android starter-project template-project

Maintainability License

Android Base

Android Base is a boilerplate project created by Rootstrap for new projects using Kotlin 1.3.61. The main objective is helping any new projects jump start into feature development by providing a handful of functionalities.

Prerequisites

Installation

  1. Clone

  2. Build with Android Studio

To manage user and session after sign in/up we store that information in Preferences. The parameters that we save are due to the usage of Device Token Auth for authentication on the server side.

Please Check

ResponseInterceptor.kt
AuthenticationInterceptor.kt

to handle the server side authentication, in case you need to modify them:

Usage

Key File encryption

Build signing requires a developer-owned keystore. Location and credentials for it are specified in gradle.properties. Likewise submission to Google Play requires a Developer API key in .json format (google-api.json). It is recommended that these files remains outside the source repo

We suggest using git secret as a simple and secure solution for keeping these sensitive files in the repo. See Config for detailed instructions.

Build and Release with Fastlane

We provide configuration files for automating build, test and submission of the application using Fastlane

Requirements

Usage

Lanes for each deployment target example are provided with some basic behavior:

Check fastlane/Appfile and fastlane/Fastfile for more information.

CI/CD configuration with Bitrise (updated on Dec 12th 2021)

We are going to start using a tool called Bitrise to configure the CI/CD pipelines for mobiles apps.

--> For Android apps you can find how to do it in this link: https://www.notion.so/rootstrap/Android-CI-CD-26d4abd4f2454224be8f617110147366

Continuous Integration with GitHub Actions (DEPRECATED)

We provide an example workflow cicd.yml including two jobs for running under GitHub Actions, which can be modified according to the specifics of each project:

Analytics

How use: In the Application class -> onCreate

Analytics.addProvider(GoogleAnalytics(applicationContext))
Analytics.addProvider(MixPanelAnalytics(applicationContext))

or an array of providers Analytics.addProviders(arrayOfProviders)

then use: Analytics.track(PageEvents.visit(VISIT_MAIN)) or for events Analytics.track(UserEvents.login()) in order to track the login event.

Utility extensions

We have a bunch of pre-made extensions usually used on every project to accelerate feature development. you can access them in the util.extensions package. They include but are not limited to :

Code Quality Standards

In order to meet the required code quality standards, this project uses Ktlint and Detekt

Contributing

Bug reports (please use Issues) and pull requests are welcome on GitHub at android-base. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The library is available as open source under the terms of the MIT License.

NOTE: Remove the free LICENSE file for private projects or replace it with the corresponding license.

Credits

Android Base is maintained by Rootstrap with the help of our contributors.