Introducing the Structure Templates | by Jose Alcérreca | Android Builders | Dec, 2022


We launched a brand new challenge on Github referred to as Android Structure Starter Templates.

The objective of those templates is to get you began shortly when doing an experiment or beginning a brand-new app from scratch. They observe the brand new Structure suggestions that we launched not too long ago, that are a abstract of the official Structure information.

These templates aren’t empty, they comprise some opinions within the type of architectural patterns and used libraries:

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

Templates are bundled inside every Studio launch and we would like this challenge to all the time use the newest dependencies to get you began as shortly as potential. Having it on Github lets us automate upkeep with instruments like Renovate.

Proper now the repository incorporates two templates:

  • base — Reactive structure, Compose, database, single module
  • multimodule — Base template applied in a number of modules

The challenge features a customizer.sh script that renames recordsdata and packages, and cleans all the pieces up. It really works on Linux and macOS (with bash 4 and above). On Home windows, you need to use the Home windows Subsystem for Linux. When you discover any compatibility points with the script, please file a bug.

  1. Clone the repository, optionally selecting a department. For instance, to take a look at the base department:
git clone https://github.com/android/architecture-templates.git --branch base

2. Run the customizer script:

bash customizer.sh your.package deal.title DataItemType [YourAppName]
  • your.package deal.title is your app ID (needs to be lowercase)
  • DataItemType is used for the title of the principle display, uncovered state and knowledge base entity (needs to be PascalCase).
  • Optionally, you may specify a reputation to your utility (needs to be in PascalCase).

Notice: the customizer script requires bash 4 and above. You may need to put in a contemporary model on macOS:

brew set up bash

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles