Initial Configuration
1.0.0 · Feature
This wiki will help you to configure your android project before start using the codebase. Let's start!
Info
This codebase is not boilerplate. It doesn't generate all the file you need after adding it. You can see it as a library or dependency that you use in your project.
Download¶
To add this codebase to your android project, follow this steps:
-
Open your global
gradle.properties
file or create it if you don't already have it, open and add these properties inside it:- For Windows :
C:\Users\<you>\.gradle\gradle.properties
- For Mac/Linux :
/Users/<you>/.gradle/gradle.properties
gradle.properties// Ask maintainer for user credential nexus_username=?? nexus_password=?? nexus_dev=??
- For Windows :
-
Add repository to your project:
root build.gradleallprojects { repositories { google() mavenCentral() maven { url "https://jitpack.io" } maven { url "https://developer.huawei.com/repo/" } maven { url properties["nexus_dev"] ?: "https://www.sonatype.com/products/repository-pro" content { includeGroup "android" } credentials { username properties["nexus_username"] ?: "developer" password properties["nexus_password"] ?: "password" } } } }
settings.gradledependencyResolutionManagement { repositories { google() mavenCentral() maven { url "https://jitpack.io" } maven { url "https://developer.huawei.com/repo/" } maven { url properties["nexus_dev"] ?: "https://www.sonatype.com/products/repository-pro" content { includeGroup "android" } credentials { username properties["nexus_username"] ?: "developer" password properties["nexus_password"] ?: "password" } } } }
-
In your app
build.gradle
inside android, check that these lines are provided. If not, add them yourself:build.gradleandroid{ defaultConfig { ... minSdkVersion 21 multiDexEnabled true } ... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = "1.8" } }
-
In your app
build.gradle
inside dependencies, add this line:build.gradledependencies { ... implementation platform('android:codebase:${latestVersion}') // (1) implementation 'android:codebase-data' // (2) implementation 'android:codebase-service' // (3) implementation 'android:codebase-presentation' implementation 'android:codebase-utils' }
- You must define this, it works as BOM (Bill of Material). It determines which version of the codebase's module will be used in your project.
- You can choose one, two, or even all the modules of the codebase based on your needs.
- No need to specify version.
You can check here for latest releases
-
Gradle sync, and that's it!
Demo¶
You can follow this demo here to configure your Android Application to implement codebase.