You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
4
5
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.
6
9
7
10
## Setup
8
-
1. Just click on [](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 [](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`.
9
13
2. Set your application ID in `Versions.kt`
10
14
3. Set the package name in `AndroidManifest.xml` file of `:app` module .
11
15
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
15
19
8. That's all. Start your app development journey now 🎉.
16
20
17
21
## Good Practices
18
-
* Add all dependencies version in `Versions.kt`
22
+
* Add all dependencies versions in `Versions.kt`
19
23
20
24
```kotlin
21
25
object Versions {
22
26
constval kotlin ="1.3.50"
23
27
constval awesomeLibrary ="x.y.z"
28
+
// TODO: add the library version
24
29
...
25
30
}
26
31
```
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`.
28
33
29
34
```kotlin
30
35
object Dependencies {
@@ -44,6 +49,7 @@ object Dependencies {
44
49
...
45
50
}
46
51
```
52
+
47
53
* Always import dependency from `Dependencies.kt` in `build.gradle.kts` file.
48
54
49
55
```kotlin
@@ -118,7 +124,7 @@ fun Project.importCommonDependencies() {
118
124
dependencies {
119
125
...
120
126
implementation(Dependencies.material)
121
-
// TODO: add your dependencies
127
+
// TODO: add your common dependencies
122
128
..
123
129
}
124
130
}
@@ -128,7 +134,8 @@ fun Project.importCommonDependencies() {
128
134
129
135
## Modules Structure
130
136
*`: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).
132
139
133
140
> **Note**: Don't put the resources inside `:base` module since it can be updated from remote repo, please treat `:base` module as library.
134
141
@@ -140,6 +147,27 @@ fun Project.importCommonDependencies() {
140
147
*[Timber](https://github.com/JakeWharton/timber), for logging.
141
148
*[Epoxy](https://github.com/airbnb/epoxy), for RecyclerView complex view layout.
142
149
150
+
## How to Update
151
+
Keep this repository as one of your project tracked remote.
0 commit comments