Skip to content

rauaap/android-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android container build template

A minimal Android app skeleton with a fully containerized, CLI-driven Gradle build. No JDK, Android SDK, or Gradle needed on the host — everything runs inside a podman container defined by the Containerfile. The only host dependency is podman (and adb, if you want to install on a device).

Layout

Containerfile          Fedora + JDK 21 + Android SDK + Gradle toolchain
Makefile               build / shell / install targets (podman wrapper)
build.gradle           root project — pins the Android Gradle Plugin version
settings.gradle        project name + module list
app/                   the application module (one-activity skeleton)

Build

Build the toolchain image once:

make image

Build a debug APK (rebuilds the image if needed):

make debug

Output: app/build/outputs/apk/debug/app-debug.apk

Other targets:

make release            # assembleRelease
make clean              # gradle clean
make gradle ARGS="tasks"   # run any gradle task in the container
make shell              # interactive shell inside the build container

The Gradle cache is persisted in a named volume (android-gradle-cache) so incremental builds and the debug keystore survive between runs.

Install on a device

The build stays containerized; only adb runs on the host:

sudo dnf install android-tools     # Fedora
make install                       # adb install -r the debug APK

Starting a new app from this template

Replace each placeholder value below. The package id (com.example.app) must be changed in all four of its locations together — namespace, applicationId, the source directory, and the package declaration.

Placeholder Value Where
Package id com.example.app app/build.gradle (namespace + applicationId), source dir app/src/main/java/com/example/app/, package line in MainActivity.java
Project name AndroidApp settings.gradle (rootProject.name)
App label AndroidApp app/src/main/res/values/strings.xml (app_name)
Image / cache names android-builder, android-gradle-cache Makefile (IMAGE, GRADLE_CACHE) — optional
Launcher icon placeholder "A" art app/src/main/res/drawable/ic_launcher_foreground.xml

Bump SDK / build-tools / Gradle versions in the Containerfile ARGs if needed.

Notes

  • Container-only by design. There is no Gradle wrapper (gradlew); the pinned Gradle version lives solely in the Containerfile. Build through make, not on the host.
  • SDK level, build-tools, and Gradle versions are all ARGs at the top of the Containerfile — change them in one place.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors