Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/foedusprogramme/gramophone/llms.txt

Use this file to discover all available pages before exploring further.

Building Gramophone requires Android Studio, git, and a reasonably fast internet connection to download dependencies and submodules.

Prerequisites

  • Android Studio (latest beta version) — download from developer.android.com/studio
  • git with submodule support
  • A fast internet connection (Media3 is included as a git submodule and is large)
  • An Android signing keystore (required to sign the APK)

Build steps

1

Clone the repository

Clone the Gramophone repository from GitHub:
git clone https://github.com/FoedusProgramme/Gramophone.git
cd Gramophone
2

Initialize submodules

Gramophone includes Media3 and other dependencies as git submodules. You must initialize them before building — the build will fail without this step.
git submodule update --init --recursive
This may take a few minutes depending on your connection speed.
3

Create package.properties

Gramophone uses a package.properties file in the repository root to identify the build source. Create this file with the following content:
package.properties
releaseType=SelfBuilt
Save it as package.properties in the root folder of the repository (the same directory as settings.gradle.kts). The releaseType value is embedded into the APK’s BuildConfig and must not contain a double-quote character.
If this file is missing and the releaseType Gradle property is not set, the build will fail with a file-not-found error.
4

Import your signing keystore in Android Studio

Open the project in Android Studio. When prompted, or through Build > Generate Signed Bundle / APK, import your signing keystore.You can also supply signing credentials via Gradle properties. The build file reads the following properties when present:
app/build.gradle.kts
signingConfigs {
    create("release") {
        if (project.hasProperty("AKANE_RELEASE_KEY_ALIAS")) {
            storeFile = file(project.properties["AKANE_RELEASE_STORE_FILE"].toString())
            storePassword = project.properties["AKANE_RELEASE_STORE_PASSWORD"].toString()
            keyAlias = project.properties["AKANE_RELEASE_KEY_ALIAS"].toString()
            keyPassword = project.properties["AKANE_RELEASE_KEY_PASSWORD"].toString()
        }
    }
}
Set these in your ~/.gradle/gradle.properties file (not in the repository) to keep credentials out of source control.
5

Build the app

Select a build variant in Android Studio (Build > Select Build Variant) and then run Build > Make Project, or use the Gradle wrapper from the command line:
./gradlew assembleRelease
The output APK is written to app/build/outputs/apk/.

Build variants

The build file defines the following variants:
VariantMinifiedShrunkNotes
releaseYesYesStandard release build.
debugNoNoIncludes LeakCanary and pseudo-locales. Application ID is org.akanework.gramophone.debug.
userdebugNoNoProfileable, JNI-debuggable, pseudo-locales enabled. Superset of release.
nonMinifiedReleaseNoYesRelease build without R8 minification. Useful for stack trace analysis.
profilingYesYesProfileable release build for performance profiling.
benchmarkReleaseYesYesUsed with the baselineprofile module for generating baseline profiles.

Build configuration reference

Key values from app/build.gradle.kts:
app/build.gradle.kts
android {
    namespace = "org.akanework.gramophone"
    compileSdk = 37

    defaultConfig {
        applicationId = "org.akanework.gramophone"
        minSdk = 21
        targetSdk = 35
        versionCode = 20
        versionName = "1.0.17"
    }
}
PropertyValue
Application IDorg.akanework.gramophone
Version name1.0.17
Version code20
compileSdk37
minSdk21 (Android 5.0)
targetSdk35

Reproducible builds

Gramophone is configured to produce reproducible builds where possible:
  • PNG crunching is disabled (isCrunchPngs = false) so asset bytes are not altered by the build toolchain.
  • Generated timestamps are excluded from the aboutlibraries metadata file.
  • VCS info is not embedded in any build type (vcsInfo { include = false }).
  • Dependency metadata is excluded from the APK and bundle (dependenciesInfo.includeInApk = false).
These settings mean that two builds from the same source tree and the same signing key should produce byte-identical APKs, which is required for F-Droid’s reproducible build verification.

Build docs developers (and LLMs) love