Skip to content

Commit 3ef750c

Browse files
committed
Update README
Change project description, good practices and how to update section, fix some typos and grammar.
1 parent ad7ecd3 commit 3ef750c

2 files changed

Lines changed: 38 additions & 9 deletions

File tree

README.md

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
![Language](https://img.shields.io/badge/language-kotlin-blue?logo=kotlin) ![License](https://img.shields.io/badge/License-MIT-brightgreen)
1+
![Language](https://img.shields.io/badge/language-kotlin-blue?logo=kotlin) ![License](https://img.shields.io/badge/License-MIT-brightgreen) ![Version](https://img.shields.io/badge/Version-0.0.1-orange)
22

3-
The `Base` project provides a Android app project template that includes the base modules/classes, setups for **Gradle Kotlin DSL** and eliminates boilerplate code.
3+
# AndroidBase
4+
The `AndroidBase` project provides a Android app project template that includes the base modules/classes (ex: BaseActivity, BaseFragment, BaseViewModel ... etc.), setups for **Gradle Kotlin DSL** and eliminates boilerplate code.
45

5-
It helps you to quickly create a well configured Android starter application with the most popular libraries (Ex: Android Architecuture Component, Retrofit/OkHttp, RxJava, Logging...etc.). It creates and configures your project for you. Just focus on code development!
6+
It helps you to create a well configured Android starter application with the most popular libraries (Ex: Android Architecuture Component, Retrofit/OkHttp, RxJava, Logging ... etc.). It creates and configures your project for you. Just start and focus on your rocket app development!
7+
8+
> This project is suitable for those apps that fetch data from network and display data in list structure.
69
710
## Setup
8-
1. Just click on [![Clone this template](https://img.shields.io/badge/-Clone%20template-brightgreen)](https://github.com/enginebai/Base/generate) button to create a new repo starting from this template. Or you can clone this project by `git clone git@github.com:enginebai/Base.git` .
11+
0. Just click on [![Clone this template](https://img.shields.io/badge/-Clone%20template-brightgreen)](https://github.com/enginebai/Base/generate) button to create a new repo starting from this template. Or you can clone this project by `git clone git@github.com:enginebai/Base.git` .
12+
1. Change your project name in `settings.gradle.kts`.
913
2. Set your application ID in `Versions.kt`
1014
3. Set the package name in `AndroidManifest.xml` file of `:app` module .
1115
4. Select `com.enginebai.project` directory in "Project" tool window and rename package for your app.
@@ -15,16 +19,17 @@ It helps you to quickly create a well configured Android starter application wit
1519
8. That's all. Start your app development journey now 🎉.
1620

1721
## Good Practices
18-
* Add all dependencies version in `Versions.kt`
22+
* Add all dependencies versions in `Versions.kt`
1923

2024
```kotlin
2125
object Versions {
2226
const val kotlin = "1.3.50"
2327
const val awesomeLibrary = "x.y.z"
28+
// TODO: add the library version
2429
...
2530
}
2631
```
27-
* Add all 3rd-party dependencies in `Dependencies.kt`
32+
* Define all 3rd-party dependencies in `Dependencies.kt`, and use all versions definition in `Versions.kt`.
2833

2934
```kotlin
3035
object Dependencies {
@@ -44,6 +49,7 @@ object Dependencies {
4449
...
4550
}
4651
```
52+
4753
* Always import dependency from `Dependencies.kt` in `build.gradle.kts` file.
4854

4955
```kotlin
@@ -118,7 +124,7 @@ fun Project.importCommonDependencies() {
118124
dependencies {
119125
...
120126
implementation(Dependencies.material)
121-
// TODO: add your dependencies
127+
// TODO: add your common dependencies
122128
..
123129
}
124130
}
@@ -128,7 +134,8 @@ fun Project.importCommonDependencies() {
128134
129135
## Modules Structure
130136
* `:base` module: It defines the base, common and utilities classes.
131-
* `:app` module: That's your app module, just like a normal Android app project. You puts all resources that app used, including strings, colors, dimensions, drawables. Or you can create `:common` modules for that if you use multi-modules project.
137+
* `:app` module: That's your app module, just like a normal Android app project. You put all resources that app used, including strings, colors, dimensions, drawables. Or you can create a new modules (ex: `:common`) for that if you use multi-modules project.
138+
* `/buildSrc`: It enables you to write the build script (`*.gradle.kts` files) in kotlin to manage dependencies and gets better IDE completion support. It gives you a way to develop build code more like regular code. More information please check [official document](https://docs.gradle.org/current/userguide/organizing_gradle_projects.html#sec:build_sources).
132139

133140
> **Note**: Don't put the resources inside `:base` module since it can be updated from remote repo, please treat `:base` module as library.
134141
@@ -140,6 +147,27 @@ fun Project.importCommonDependencies() {
140147
* [Timber](https://github.com/JakeWharton/timber), for logging.
141148
* [Epoxy](https://github.com/airbnb/epoxy), for RecyclerView complex view layout.
142149

150+
## How to Update
151+
Keep this repository as one of your project tracked remote.
152+
153+
```shell
154+
> git remote -v
155+
> origin git@github.com:yourName/YourAwesomeProject.git (fetch)
156+
> origin git@github.com:yourName/YourAwesomeProject.git (push)
157+
> base git@github.com:enginebai/AndroidBase.git (fetch)
158+
> base git@github.com:enginebai/AndroidBase.git (push)
159+
```
160+
161+
And you can update by git pull or rebase from this remote repository.
162+
163+
```shell
164+
> git pull --rebase base master # pull and rebase
165+
or
166+
> get pull base master # pull and merge
167+
```
168+
169+
Resolve the conflicts and commit, this project will be one of your codebase module.
170+
143171
## LICENSE
144172

145173
```

settings.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
include(":app", ":base")
2-
rootProject.name="Base"
2+
// TODO: 0. change your project name
3+
rootProject.name="AndroidBase"

0 commit comments

Comments
 (0)