Introducing the Architecture Templates

Jose Alcérreca
Android Developers
Published in
2 min readDec 5, 2022

We released a new project on Github called Android Architecture Starter Templates.

The goal of these templates is to get you started quickly when doing an experiment or starting a brand-new app from scratch. They follow the new Architecture recommendations that we released recently, which are a summary of the official Architecture guide.

These templates are not empty, they contain some opinions in the form of architectural patterns and used libraries:

A new template on Github? Why not include it in Android Studio?

Templates are bundled inside each Studio release and we want this project to always use the latest dependencies to get you started as quickly as possible. Having it on Github lets us automate maintenance with tools like Renovate.

Branches

Right now the repository contains two templates:

  • base — Reactive architecture, Compose, database, single module
  • multimodule — Base template implemented in multiple modules

Requirements

The project includes a customizer.sh script that renames files and packages, and cleans everything up. It works on Linux and macOS (with bash 4 and above). On Windows, you can use the Windows Subsystem for Linux. If you find any compatibility issues with the script, please file a bug.

Usage

  1. Clone the repository, optionally choosing a branch. For example, to check out the base branch:
git clone https://github.com/android/architecture-templates.git --branch base

2. Run the customizer script:

bash customizer.sh your.package.name DataItemType [YourAppName]
  • your.package.name is your app ID (should be lowercase)
  • DataItemType is used for the name of the main screen, exposed state and data base entity (should be PascalCase).
  • Optionally, you can specify a name for your application (should be in PascalCase).

Note: the customizer script requires bash 4 and above. You might have to install a modern version on macOS:

brew install bash

Let us know what you think!

We'd like feedback on:

  • The included libraries and overall functionality
  • The customizer script
  • Other variants that you might be missing

To report feedback, feel free to open a feature request or drop me a message.

--

--

Android Developers
Android Developers

Published in Android Developers

Articles on modern tools and resources to help you build experiences that people love, faster and easier, across every Android device.

Jose Alcérreca
Jose Alcérreca

Written by Jose Alcérreca

Developer Relations Engineer @ Google, working on Android

Responses (3)