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.
Right now the repository contains two templates:
base— Reactive architecture, Compose, database, single module
multimodule— Base template implemented in multiple modules
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.
- Clone the repository, optionally choosing a branch. For example, to check out the
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.nameis your app ID (should be lowercase)
DataItemTypeis 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