mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-11-17 14:54:38 +00:00
1.8 KiB
1.8 KiB
How to Set Up an Android Development Environment
If you'd like to contribute to the Android project, but do not currently have a development environment setup, follow the instructions in this guide.
Prerequisites
Install Android Studio with the default options if you do not already have it.
Setting Up Android Studio
- Open the
Source/Androidproject in Android Studio, let any background tasks finish, and Android Studio will automatically download the required SDK components and tooling. - Use the hammer icon or Build > Assemble 'app' Run Configuration to compile the
:appmodule, then choose Build > Generate App Bundles or APKs > Generate APKs to produce the APK inSource/Android/app/build/outputs/apk.
Import the Dolphin code style
The project maintains a custom IntelliJ/Android Studio style file to keep Java and Kotlin formatting consistent.
- Go to File > Settings > Editor > Code Style (or Android Studio > Settings > Editor > Code Style on macOS).
- Click the gear icon and choose Import Scheme.
- Select
Source/Android/code-style-java.xmlfrom the repository. - Ensure that Dolphin-Java is selected.
Format code before opening a pull request
Before committing or submitting a pull request, reformat any Java or Kotlin files you modified:
- Use Code > Reformat Code (or press
Ctrl+Alt+L/⌥⌘Lon macOS) with the Dolphin code style selected. - Re-run formatting after edits to keep spacing, imports, and wrapping consistent with the rest of the project.
Compiling from the Command-Line
For command-line users, any task may be executed with cd Source/Android followed by gradlew <task-name>. In particular, gradlew assemble builds debug and release versions of the application (which are placed in Source/Android/app/build/outputs/apk).