Phase 6 · Professional AndroidModule 51~30 min read

Permissions, Publishing & the Play Store

Handle runtime permissions and take your app all the way to a live Play Store listing.

What you'll learn

You can build a complete, tested app — the final step is getting it into people's hands. This module covers the last professional essentials: asking for runtime permissionsrespectfully, preparing a signed release build, and publishing through the Google Play Console.

By the end you'll be able to:

  • Request runtime permissions in Compose
  • Understand app signing and build types
  • Prepare a shrunk, signed release bundle
  • Navigate the Play Console and ship a quality listing

Runtime permissions

Sensitive capabilities — camera, location, contacts — require the user's explicit consent at runtime, not just a manifest entry. You declare the permission in the manifest, then ask for it when the feature is used:

AndroidManifest.xml
<!-- AndroidManifest.xml — declare what the app needs -->
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />

In Compose, request it with rememberLauncherForActivityResult and the RequestPermission contract, which shows the system dialog and gives you the result:

CameraButton.kt
@Composable
fun CameraButton(onGranted: () -> Unit) {
    val launcher = rememberLauncherForActivityResult(
        ActivityResultContracts.RequestPermission(),
    ) { granted ->
        if (granted) onGranted()
        // else: keep the screen usable and offer a non-camera fallback.
    }

    Button(onClick = { launcher.launch(Manifest.permission.CAMERA) }) {
        Text("Take photo")
    }
}
Focused example: keep your generated package and theme. Add the shown APIs to your Compose project using Android Studio imports.

Tip

Ask in context, at the moment the user taps the feature — not all at once on launch — and explain why first if it isn't obvious. Always handle denial gracefully: the feature should degrade, never crash. Respecting permissions builds trust (and is required to pass Play review). The Activity Result API shown here is enough for the core permission flow.

App signing & build types

Every Android app is digitally signed — the signature proves updates come from the same developer. Projects have two build types: debug (auto-signed, used while developing) and release (the optimized build you ship). For publishing, Google recommends Play App Signing: you upload with your own key, and Google manages the final signing key securely.

Watch out

Protect signing material and keep private backups. With Play App Signing, distinguish theapp signing key used for distributed apps from your upload key used to authenticate uploads. A lost upload key can be reset through the supported process; it is not the same as losing a self-managed app signing key needed to sign compatible updates.

Preparing a release

Configure the release build to enable R8, which shrinks and obfuscates your code, with resource shrinking to remove unused resources — a smaller, faster, harder-to-reverse-engineer app. Then you build an Android App Bundle (.aab), the format Play requires (Google generates optimized APKs per device from it):

build.gradle.kts
// build.gradle (app) — the release build type
android {
    buildTypes {
        release {
            isMinifyEnabled = true            // shrink & obfuscate with R8
            isShrinkResources = true          // drop unused resources
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro",
            )
        }
    }
}
// Build the upload artifact:  ./gradlew bundleRelease  →  app-release.aab
Focused example: keep your generated package and theme. Add the shown APIs to your Compose project using Android Studio imports.

Note

Always test the release build before shipping, not just debug. Minification can remove code that reflection relies on (a reason serialization libraries ship ProGuard rules), and the release build behaves and performs differently. Catch it on your device, not in user reviews.

The Play Console

The Google Play Console is where you manage your app. A one-time developer account registration is required. The path to live:

  1. Create the app and complete the content questionnaires (privacy policy, data safety, content rating, target audience).
  2. Upload your .aab to a testing track first — internal, then closed/open testing — to catch issues with real users.
  3. Fill in the store listing (below).
  4. Roll out to production — optionally a staged rollout to a percentage of users first.

Quality & store listing

Your store listing is your storefront: a clear title and description, a compelling icon, screenshots (and ideally a short video), and a feature graphic. First impressions decide installs. Beyond the listing, aim for genuine quality — follow Material guidelines, support dark mode and different screen sizes, handle errors and offline states, respect the user's data, and keep the app fast. That's everything this course has been building toward.

Practice: one small working feature

Prepare a release checklist covering permissions, signing, versioning, and a smoke test.

Check your result

The app handles a denied permission, builds a signed release artifact, and installs as an update during your own checks.

Remember

An APK can be installed directly; an AAB is a publishing artifact. Keep signing credentials private and check current Play requirements.

Recap & quick check

Key takeaways

  • Sensitive features need runtime permissions: declare in the manifest, then request via rememberLauncherForActivityResult.
  • Ask for permissions in context, explain why, and handle denial gracefully — never crash.
  • Distinguish app signing keys from upload keys; protect both and use the supported upload-key reset process when applicable.
  • Release builds enable R8 (shrink/obfuscate); ship an Android App Bundle (.aab), and test the release build.
  • Publish via the Play Console: complete the questionnaires, test on tracks, craft a strong store listing, then roll out.

Quick check

1. When should you request a runtime permission like camera?

2. Declaring a permission in the manifest alone is enough for the camera. True or false?

3. Why must you protect your signing key?

4. What artifact do you upload to Google Play?

5. Before production, you should…

Review Android Security & Privacy, then prepare the Phase 6 tested score calculator capstone. Demonstrate its numerical unit tests and Compose user-flow test before building the final Study Tasks app. Signing a release can be a separate follow-up exercise.