Git Product home page Git Product logo

android-base's Introduction

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

  • Android SDK
  • Android Studio
  • Firebase google-services.json file.
  • Change your release key information on the build.gradle:
signingConfigs {
    releaseConfig {
        keyAlias setAlias
        keyPassword setPassword
        storeFile file(setStoreFile)
        storePassword setStorePassword
    }
}
  • Build the project with Android Studio.

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

  • You can use this open source project as a template of your new Android projects.

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

  • Ensure JDK 1.8 is installed
  • Ensure proper version of Android SDK command line tools is installed
  • Install fastlane using
[sudo] gem install fastlane -NV

or alternatively using brew cask install fastlane

Usage

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

  • Each target has two options: debug_x and deploy_x.
  • Each option will:
    • Increment the build number.
    • Run gradlew clean
    • Run gradlew androidDependencies
    • Build the app (gradle assemble) for the target flavor.
  • The deploy lanes will additionaly submit the APK to the corresponding track in the Play Store.

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

Continuous Integration with GitHub Actions

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:

  • ci
    • runs upon every push and PR
    • installs Fastlane and runs debug_dev lane
  • release
    • runs upon every push to develop or master
    • downloads keystore and Google api key from S3 (credentials need to be present in repo Secrets)
    • installs Fastlane and runs deploy_* lane depending on branch (Dev if in develop, Stsaging if in master) - This could be easily modified to release Prod instead

Analytics

  • Add analytics manager:
    1. Firebase
    2. MixPanel[Optional]

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.

  • For firebase replace the file: google-services.json with the once for your App and follow the Firebase instructions.
  • For MixPanel, you have to replace the API key: <string name="mixpanel_api_key">mixpanel_api_key</string>

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.

android-base's People

Contributors

aguskoll avatar agustinkoll-rootstrap avatar amaury901130 avatar camilamoscatelli avatar devops-rs avatar jjszolno avatar lmiotti avatar marcossalto avatar mato2593 avatar sebalopez avatar ximenaperez avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.