Development Environment Setup
This guide walks through setting up your development environment to contribute code to Andor's Trail.
Prerequisites
Java Development Kit (JDK) 8 or higher
Git
Android SDK (API level 21 or higher)
4+ GB RAM recommended
2+ GB disk space for Android SDK
Step 1: Install Java Development Kit (JDK)
Windows
Download JDK from oracle.com or use OpenJDK.
Run the installer and follow the prompts.
Note the installation directory (e.g.,
C:\Program Files\Java\jdk-11.0.x).Set environment variables:
Right-click "This PC" → Properties → Advanced system settings.
Click "Environment Variables".
Add new system variable:
Name:
JAVA_HOMEValue:
C:\Program Files\Java\jdk-11.0.x(your JDK path)
Add to PATH:
%JAVA_HOME%\bin
Verify: Open Command Prompt and run
java -version
macOS
bash# Using Homebrew
brew install openjdk@11
# Set JAVA_HOME in ~/.zshrc or ~/.bash_profile
export JAVA_HOME=/usr/local/opt/openjdk@11
# Verify
java -versionLinux (Ubuntu/Debian)
bashsudo apt update
sudo apt install openjdk-11-jdk
# Verify
java -versionStep 2: Install Android Studio
Windows & macOS
Download from developer.android.com
Run the installer and follow the prompts.
Choose "Custom Setup" to select components:
Android SDK
Android SDK Platform-Tools
Android Emulator
Android SDK Build-Tools
Accept license agreements.
Specify Android SDK location (default: ~/Android/sdk).
Linux
bash# Download Android Studio
# Extract to ~/android-studio
tar -xzf android-studio-linux.tar.gz -C ~/
# Add to PATH in ~/.bashrc
export PATH="$PATH:~/android-studio/bin"
# Run
./android-studio/bin/studio.shStep 3: Install Git
Windows
Download from git-scm.com.
Use default installation settings.
Verify: Open Command Prompt, run
git --version
macOS
bashbrew install git
git --versionLinux
bashsudo apt install git
git --versionStep 4: Clone Andor's Trail Repository
bash# Navigate to desired directory
cd ~/Development
# Clone repository
git clone https://github.com/AndorsTrailRelease/andors-trail.git
cd andors-trail
# Verify structure
ls -laYou should see:
textAndorsTrail/ # Main game module
AndorsTrailEdit/ # Legacy editor
travis/ # CI/CD scripts
.git/ # Git directory
README.mdStep 5: Open Project in Android Studio
Launch Android Studio.
Click "Open" or "File → Open..."
Navigate to the cloned repository root.
Select the folder and click "OK".
Android Studio will index the project (this may take 1-2 minutes).
Let Gradle sync complete (bottom status bar shows "Gradle sync successful").
Step 6: Configure SDK in Android Studio
If Android SDK is not detected:
Go to File → Settings (or Android Studio → Preferences on macOS).
Navigate to Appearance & Behavior → System Settings → Android SDK.
Click "Edit" next to "Android SDK Location".
Select your SDK directory (typically ~/Android/sdk).
Click "Next" and "Finish".
Let the download complete.
Step 7: Build the Project
Using Android Studio GUI
Click Build → Make Project.
Wait for the build to complete.
Check the "Build" tab for the success message.
Using Command Line
bash# Navigate to project root
cd andors-trail
# Build APK
./gradlew assembleDebug
# Build signed APK
./gradlew assembleReleaseStep 8: Run on Emulator or Device
Create Virtual Device (Emulator)
Tools → Device Manager.
Click "Create Device".
Select a device definition (e.g., Pixel 4).
Select API Level (21+).
Click "Finish".
Devices will appear in Device Manager.
Run on Emulator
Click Run → Run 'AndorsTrail'.
Select the emulator device.
Click "OK".
App will launch in the emulator.
Run on Physical Device
Enable Developer Mode on Android device:
Go to Settings → About Phone.
Tap "Build Number" 7 times.
Developer options now appear in Settings.
Enable USB Debugging in Developer Options.
Connect the device via USB.
Click Run → Run 'AndorsTrail'.
Select a physical device.
Click "OK".
Step 9: View Javadoc and API Sources
View Android API Documentation
In Android Studio, click Help → Download PDF Documentation.
Or visit developer.android.com/reference.
Generate Project Javadoc
bash./gradlew javadocOutput appears in build/docs/javadoc/
View Source Code
Right-click any class and select "Go to Definition" or press Ctrl+Click (Cmd+Click on macOS).
Step 10: Set Up Debugging
Enable Debugging in Android Studio
Preferences → Debugger → General.
Set breakpoints by clicking in the code margin.
Run → Debug 'AndorsTrail'.
The debugger will stop at breakpoints.
Use the Variables panel to inspect the object state.
View Logcat
View → Tool Windows → Logcat.
Filter logs by app name:
com.gpl.rpg.AndorsTrailSet log level (Verbose, Debug, Info, Warning, Error).
Offline Setup (No Internet Access)
If developing offline, you can still build the project:
Appendix A: Pre-Downloaded SDK Setup
On a connected computer, download Android SDK build-tools and platforms.
Copy
~/Android/sdk/directory to USB drive.Transfer to offline machine:
~/Android/sdk/Android Studio will detect the pre-existing SDK.
Appendix B: Gradle Wrapper
The project includes gradlew wrapper, which downloads Gradle automatically. First build requires the internet.
Troubleshooting
"SDK Location Not Found"
Create file local.properties in project root:
textsdk.dir=/path/to/android/sdk"Gradle Sync Failed"
File → Invalidate Caches and Restart.
Or:
./gradlew clean build --refresh-dependencies
"Java Home Not Set"
Set environment variable:
Windows: See Step 1.
macOS/Linux:
export JAVA_HOME=$(which java)
"Emulator Not Starting"
File → Settings → System Settings → Emulation Settings.
Enable "Use Host GPU".
Allocate more RAM (Device Manager → Edit Device).
"App Crashes on Launch"
Check Logcat for error messages.
Verify Android API level (21+).
Check AndroidManifest.xml permissions.
Next Steps
Read the Code Contribution Workflow guide.
Explore Core Code Components documentation.
Review existing issues on the forums.
Choose an issue to work on.
Create a feature branch:
git checkout -b feature/issue-name
Development Workflow
Make code changes.
Run tests:
./gradlew testBuild APK:
./gradlew assembleDebugTest on device/emulator.
Commit changes:
git commit -m "Description"Push to fork:
git push origin feature/issue-nameCreate Pull Request on GitHub.
Useful Commands
bash# Clean build
./gradlew clean
# Build without testing
./gradlew build -x test
# Run specific tests
./gradlew test --tests com.gpl.rpg.AndorsTrail.SomeTest
# Check for lint errors
./gradlew lint
# Generate APK
./gradlew assembleDebug # Debug APK
./gradlew assembleRelease # Release APK
# View dependencies
./gradlew dependenciesResources
Last updated