/android-template-mvvm-xml

Simple Android MVVM (xml) Template without Compose

Primary LanguageKotlin

Android MVVM (XML) Template

Simple template for MVVM with XML (Activity & Fragment) in Android, without Compose.

Architecture

Flowcharts

Overview

  • Notices
    1. The INTERNET permission is enabled in the Manifest because there's a basic Retrofit2 usage.
    2. BuildConfig is enabled in build.gradle to securely use important variables, such as BuildConfig.API_KEY.
    3. Put important variables in keys.properties. It'll be loaded in build.gradle.
  • Core Versions
agp = "8.3.0"
kotlin = "1.9.0"
room = "2.6.1"
hilt = "2.51.1"
gson = "2.10.1"
retrofit2 = "2.11.0"
ksp = "1.9.0-1.0.13"
okhttpLogging = "4.12.0"

Usage

  1. git clone this repo
git clone https://github.com/jhj0517/android-template-mvvm-xml.git
  1. Modify git remote url with yours
git remote set-url origin git@github.com:your_name/repo_name.git
  1. Go to the Project Files tab in the File Tree view within Android Studio, not the Android or Project tab.
    • Refactor the organization name with yours organization
    • Refactor the package name with yours package
  2. Change the namespace and applicationId in the module-level build.gradle.
android {
    namespace = "com.jhj0517.android_template_mvvm_xml" // Change
    defaultConfig {
        applicationId = "com.jhj0517.android_template_mvvm_xml" // Change
    }
}
  1. Change the rootProject.name in the settings.gradle
rootProject.name = "android-template-mvvm-xml" // Change
  1. Build -> Clean Project -> Rebuild Project
  2. You're now ready to start your new project.