There are two ways to setup the project and build on your computer:
Android Studio with Android SDK
JDK(Java Development Kit)
2. Command-line(Recommended for low-end PCs)
Only Android SDK
Android Studio is Google’s official IDE (integrated development environment) which is based on Jetbrain’s IntelliJ IDEA for Android Operating System.
1. After installing Android studio and setting up SDK, copy the repo URL of template.
2. Open Android studio and click on Checkout project from version control and select the version control service on which your project being hosted on (In this case it’s Git).
3. Paste the copied repo URL and change directory of clone if necessary and click Clone.
4. Android studio will start cloning the repo.
5. It will throw a prompt saying whether you want to create android studio project for the checked out/cloned source, select Yes.
6. Now it’ll show import window. Select Import projects from external model and click Next.
7. Gradle setup window will appear, now click on Finish.
1. Open template repo and click on Clone or download and select Download ZIP.
2. Save and extract it.
3. Open Android studio and click on Import project (Gradle, Eclipse, ADT etc.).
4. Browse to the extracted template directory and press OK.
After importing project, Android studio will try to sync gradle. If the project using outdated gradle distribution then it'll throw a prompt to update gradle version manually. Click Update.
And the gradle synced successfully!.
Setting up “Run” configuration
Run is a very handy feature for testing new changes as quickly as possible. It will compile the source and automatically installs to the device which is connected through ADB.
As theme template doesn’t comes with any launch-able activity, we need to setup the Run configuration to launch nothing, so that it can compile & install silently without launching any activity.
1. Press App button and click on Edit configuration.
2. Click on Launch:, select activity to Nothing and press OK.
3. Connect phone using USB and press Run icon to start compiling and install into the connected device.
Android studio will open dialog with a list of devices connected to "ADB". Select the device you want Android studio to install the app after compilation.
Disable Instant run
Instant run is a latest feature of Android studio which pushes only updated code and resources to your connected device by performing swap which might cause issues with template as we do changes only on assets most of the time. So its recommended to disable Instant run.
1. Open Android studio Settings.
2. Select Build, Execution, Deployment and uncheck the Instant run option and press OK.
The command-line method is the simple & easiest way compared to Android studio method and its the recommended option for low-end or old PC’s.
Before proceeding further, make sure Android SDK is installed and following environment variables are set:
JDK_HOME = JDK installed path
JRE_HOME = JRE installed path
ANDROID_HOME = Android SDK installed path
2. Open the cloned/extracted directory and hover mouse to empty area and hold shift + right click and select Open PowerShell window here or if you’re on older version of windows, select Open command line window here.
3. In the command window, type
./gradlew assembleDebug and press Enter. Gradle wrapper will begin downloading dependencies and will setup everything automatically.
Gradle is syncing dependencies required for the project.
Gradle is compiling the project after syncing successfully.
Project is successfully compiled.
4. To build and install app to the connected device, type
./gradlew installDebugin the command line and press Enter.