- Shell 63.3%
- Kotlin 36.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| app | ||
| gradle | ||
| .gitignore | ||
| build.gradle | ||
| gradle.properties | ||
| gradlew | ||
| gradlew.bat | ||
| README.MD | ||
| settings.gradle | ||
| setup.sh | ||
LightweightAndroidAppTemplate
All Android apps must be light-weight
About
This is a template project for Android app development.
But... apps built from this template will be very light-weight!
In the best case, the size of the APK after the build will be 1 in 42.
Not only that, but the minimum API level has been lowered to 14, so the app can run on almost any device.
All the needless bloat has been removed—JUnit which no one uses, the flashy yet heavy‑looking and slow Material You, AppCompatActivity that has become heavier without any change, the fooyjay‑resolver that’s the enemy of F‑Droid, and all the other unnecessary extras.
As a result, the app is not only lighter, but also looks cleaner and simpler, making it easier to create a user‑friendly experience.
What are changed from default project
- Removed JUnit tests.
- Parent of activity class was changed to
Activity()fromAppCompatActivity().- Removed unnecessary codes:
enableEdgeToEdge. - Removed unused imports.
- Removed unnecessary codes:
- Toplevel element of activity layout was changed to
LinerLayoutfromandroidx.constraintlayout.widget.ConstraintLayout. - Parents of themes are changed to
@android:style/Theme.DeviceDefault.LightfromTheme.Material3.DayNight.NoActionBar. - Removed unused files or directories:
keppRules,backup_rules.xml,data_extraction_rules.xml. - Removed dependences other than
libs.androidx.activityfromapp/build.gradleandgradle/libs.versions.toml - Enabled
minifyEnabledandshrinkResourcesinapp/build.gradle minSdkVersionwas changed to 14 (Android 4.0)
How to start development with this template
To start development with this template, you have to change application ID and application name.
By default, the application ID is lightweight.androidapp.template and application name is LightweightAndroidAppTemplate.
You need to change the files that contain these names.
The files that need to be changed are as follows:
- /settings.gradle
- /app/src/main/AndroidManifest.xml
- /app/build.gradle
- /app/src/main/res/values/strings.xml
- /app/src/main/res/values/themes.xml
- /app/src/main/res/values-night/themes.xml
- /app/src/main/java/lightweight/androidapp/template/MainActivity.kt
Also, you have to change the path of MainActivity.kt based on your application ID. For example, if your application ID is com.example.MyApp, the directory structure will be as follows:
/app/src/main/java/com/example/MyApp/MainActivity.kt
At last, DO NOT FORGET to remove .git directory!!
Be careful not to commit your project to this template repository!
It can be tedious to run these tasks every time you create a project.
Therefore, I have included a script that performs all of these changes in one go.
Navigate to the project's top‑level directory and run the following:
./setup.sh
Running this script will sequentially prompt you for an Application ID and an Application name.
Enter the ID and name you plan to use for your project—do not include any spaces.
Once you provide the ID and app name, the necessary files will be rewritten, and extraneous data such as this script, the README.MD, and the .git directory will be cleaned up.
That completes the setup! You can now open the project into Android Studio, or manually edit the code and run gradlew to build it.