This repository contains copies of the original templates used by Android Studio when creating a new project.
Last updated: 2024-02-11
The templates included are:
NoActivity
EmptyActivity
BasicViewsActivity
BottomNavigationViewsActivity
EmptyViewsActivity
NavigationDrawerViewsActivity
ResponsiveViewsActivity
![new-project](https://private-user-images.githubusercontent.com/88276600/303931438-1d7f574c-c80c-43b5-b0fd-71dedb960086.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI4NDMxNTQsIm5iZiI6MTcyMjg0Mjg1NCwicGF0aCI6Ii84ODI3NjYwMC8zMDM5MzE0MzgtMWQ3ZjU3NGMtYzgwYy00M2I1LWIwZmQtNzFkZWRiOTYwMDg2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA1VDA3MjczNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQyZTY3MjZhN2QwMGMzZmFhMTA3ZThlN2ZlZTM0NDYzOGRkNGZhYThmYzEwNmM2ODRhODU1MDE5ZjA5NzhhNzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.PGSelva1Te_J5axv8J38VQIB273eYPnHsrwxuSnTpt0)
Note: The two C++ templates are not included.
The purpose of this repository is to keep copies of the templates, so that you can use them even if you don't have Android Studio installed.
For instance, some developers prefer a minimal setup, which doesn't include a full-blown IDE: It is possible to develop Android apps using just the Android SDK (maybe including the device emulator) and a terminal text editor, such as Vim or Emacs.
Unfortunately, the "New Project" templates are not available as a standalone CLI tool. They are not easily accessible from the Android Studio source code either. So you pretty much need to have Android Studio installed to get them. The aim of this repository is to provide them in a standalone form.
To use this repository, simply clone it:
git clone https://github.com/yourusername/android-studio-templates.git
You will find one folder for each template, containing the files as would be generated by Android Studio, with minimal changes (see below). Each of these folders is a standalone Android project, which can be build with Gradle and run on an Android device or emulator.
The templates were generated with the following settings:
![settings](https://private-user-images.githubusercontent.com/88276600/303931447-6cfc8ce4-ce75-4df5-8363-f8debd7980d9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI4NDMxNTQsIm5iZiI6MTcyMjg0Mjg1NCwicGF0aCI6Ii84ODI3NjYwMC8zMDM5MzE0NDctNmNmYzhjZTQtY2U3NS00ZGY1LTgzNjMtZjhkZWJkNzk4MGQ5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA1VDA3MjczNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWMzY2IyN2RlMjMwM2RjMGQzN2UwMDBhM2M0Nzc3OGRkZWZmYWUwNGYzYjkzZDAzZjNmNjhkMGVmOWUwNTU2YzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.3ApYZi_tXgDuCRyf99hM9OMHjEyNoR3ntIa2tSCNEj0)
- Android Studio version: 2023.1.1 (Latest at the time of writing)
- Language: Kotlin
- Minimum SDK: API 25, Android 7.1.1 (Highest SDK version with over 95% coverage)
- Build Configuration Language: Kotlin DSL.
The following superfluous files and folders were removed:
local.properties
(only relevant for use with Android Studio).idea
(only relevant for use with Android Studio).gradle
(build system cache)
I personally vow to keep this repository up to date as new versions of Android Studio are released. This is achievable through the use of an uncomitted script which tests and diffs the templates as new versions are released.
This repo also comes with a simple CLI tool written in Bash:
Usage: ./android-new-project <template-name> <project-name>
./android-new-project --list/-l
./android-new-project --help/-h
- <template-name> is the name of the template you want to use.
- <project-name> is the name of the project you want to create. A folder
with this name will be created in the current directory, and the template
files will be copied into it.
- This name will be converted to lowercase and CapitalizedCase, and used to name folders
and replace content accordingly.
- --list/-l will list the available templates.
- --help/-h prints this help.
Available templates:
- NoActivity
- EmptyViewsActivity
- BottomNavigationViewsActivity
- NavigationDrawerViewsActivity
- ResponsiveViewsActivity
- EmptyActivity
- BasicViewsActivity
If you want to install it system-wide, simply run make install
.
Indeed, you can add or modify templates in your local copy of this repository, and they would be available to the CLI tool too.