Project Setup
- Core Setup Prerequisites for Android Project
Create Project
- Initialize your Android project in Android Studio.
Add .gitignore
-
Set up a
.gitignorefile to exclude unnecessary files from being tracked in version control. -
Use a predefined Android
.gitignorefile to prevent committing build files, local environment settings, and other unnecessary content.# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# Virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
# Gradle files
.gradle
# Android Studio and IDE specific files
.idea/
build/
local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
# Build output directories
/build
/captures
# Native build files
.externalNativeBuild
.cxx
# Additional Android Studio settings
/.idea/dictionaries
/.idea/inspectionProfiles
/.idea/.name
/.idea/*.xml
/.idea/codeStyles/Project.xml
/.idea/sonarlint
# APK and execution files
*.apk
*.exec
# Gradle wrapper jar (not ignored)
!/gradle/wrapper/gradle-wrapper.jar
# macOS specific files
.DS_Store
Gradle Configuration
-
Configure the essential
gradle.propertiesfile to enable parallel builds, daemon mode, and caching for improved performance.Memory Settings
The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m -Dkotlin.daemon.jvm.options\="-Xmx2048m"Gradle Caching
Enables Gradle build caching to reuse outputs from previous builds, improving build performance.
org.gradle.caching=trueParallel Execution
When configured, Gradle will run in incubating parallel mode. This option should only be used with decoupled projects. More details, visit Decoupled Projects.
org.gradle.parallel=trueKotlin Code Style
Sets the Kotlin code style to "official", which follows the Kotlin coding conventions.
kotlin.code.style=official