CodeBlanks Logo Icon CodeBlanks

Building for Android

Learn APK/AAB builds for Android and the keystore.

Android build: APK and AAB

There are two primary output formats for Android: APK (Android Package) which can be installed directly onto devices, and AAB (Android App Bundle) which is required for Google Play Store submissions.

// In the Build Settings window, enable
// 'Build App Bundle (Google Play)' to generate an AAB.

The AAB format enables Google Play to dynamically deliver optimized binaries tailored to the user's device architecture.

Keystore and Package Name

Before submitting to Google Play, a Keystore holding your digital signature must be generated. If this keystore is lost, pushing future updates to the game becomes impossible.

// Package name format (Player Settings > Identification):
// com.CompanyName.GameName

The Package Name is defined using a globally unique reverse domain name structure.

Practice Generate Android package identifier

Combine domain, company, and product into the packageId variable. Then print "Paket: com.games.runner | Format: AAB" using Console.WriteLine.

Starter code

Player.cs
using System;

class AndroidPackageInfo
{
    static void Main()
    {
        string domain = "com";
        string company = "games";
        string product = "runner";
        // Paket kimligini com.sirket.urun seklinde birlestir ve yazdir
        
    }
}

Sample solution

Player.cs
using System;

class AndroidPackageInfo
{
    static void Main()
    {
        string domain = "com";
        string company = "games";
        string product = "runner";
        string packageId = $"{domain}.{company}.{product}";
        Console.WriteLine($"Paket: {packageId} | Format: AAB");
    }
}

Expected output

Paket: com.games.runner | Format: AAB

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 Which modern packaging format is required when publishing a new game on Google Play Store?

  • OBB (Expansion File)
  • IPA (iOS App Package)
  • APK (Android Package)
  • AAB (Android App Bundle) Correct answer

Explanation: Google Play Store enforces the AAB format for new apps and updates to ensure size optimization.

2 Verify Android platform

Question
if (Application.platform == RuntimePlatform.____) {
    Console.WriteLine("Android cihaz");
}
Answer
if (Application.platform == RuntimePlatform.Android) {
    Console.WriteLine("Android cihaz");
}

Explanation: The RuntimePlatform.Android constant indicates the application is running on Android OS.

3 Android build components

Term Meaning
APK Directly installable Android package
AAB Optimized package for Google Play
Keystore Key store verifying app signature
Package Name Unique reverse-domain app identity

All lessons in Expert