Migrating Fluently Speaking Apps to Android 12: Background, Technical Solutions, and Practical Implementation
This article outlines the background, technical analysis, and step‑by‑step practical migration of multiple Fluently Speaking Android applications to Android 12, covering environment upgrades, Gradle and JDK changes, CI/CD runner configuration, API adjustments, UI updates, and future outlook.
Background – In October 2021 Google released Android 12 with major security and privacy enhancements, prompting a wave of updates across Android devices and app markets in 2022. Fluently Speaking’s three major apps (English, Reading, and Kids) originally targeted Android X (API 28) and began a full Android 12 migration three years later.
Technical Solution Selection – The migration follows two main lines: (1) adapting the build environment (Android Studio, JDK, Gradle, CI/CD) and (2) adapting to new system features (SDK updates, permission changes, UI adjustments). The guiding principle is to minimize code changes and cost while ensuring a smooth transition.
Practical Implementation – Development Environment
Upgrade Android Studio to the Chipmunk version and update the full toolchain (API, Platform‑Tools, Build‑Tools). The project uses an outdated Gradle (AGP 3.4.3, Gradle 5.5.1) which fails on JDK 8 due to the new MODULE annotation in Android 12.
java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULESwitch the Gradle JDK to JDK 11:
Preferences → Build Tools → Gradle → Gradle JDK (select 11)Update Gradle configuration:
compileSdkVersion = 31
buildToolsVersion = '31.0.0'
minSdkVersion = 21
targetSdkVersion = 31CI/CD Environment
Configure GitLab‑Runner machines with Ansible, upgrading one runner’s Docker image to JDK 11:
FROM ubuntu:16.04
LABEL de.mindrunner.android-docker.flavour="built-in"
COPY --chown=root:root ./source.list /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y openjdk-11-jdk git curl unzip lib32stdc++6
RUN apt-get install -y python3-pip python3-dev && pip3 install --upgrade pip
RUN apt-get install -y wget expect vim python && apt-get install -y python-pip python-dev build-essential && pip install pathlib && pip install configparser
RUN apt-get cleanEnable the runner in GitLab settings and reference the image/tag in .gitlab-ci.yml . After these steps, both local and CI builds succeed.
API Adjustments
Address Android 12 requirements such as explicit exported declarations for activities, services, and receivers, and add the appropriate PendingIntent mutability flags. Example for exported :
<activity android:name="com.github.moduth.blockcanary.ui.DisplayActivity" android:exported="false" />Example for PendingIntent :
val pi = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT or PendingIntent.FLAG_IMMUTABLE)
} else {
PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT)
}Kotlin null‑safety checks were added throughout the codebase using ?.let{} and ?.apply{} to satisfy the stricter compiler diagnostics.
Other platform changes include handling SingleInstance mode with proper taskAffinity , declaring the SCHEDULE_EXACT_ALARM permission, respecting new sensor sampling limits, and adapting to the restricted “trampoline” behavior for notification click handling.
UI Updates
Notification custom views now require setBigCustomContentView in addition to setCustomContentView . SplashScreen customization involves setting android:windowSplashScreenBackground , android:windowSplashScreenAnimatedIcon , and android:windowSplashScreenAnimationDuration in styles.xml :
<item name="android:windowSplashScreenBackground">@color/bg_gray</item>
<item name="android:windowSplashScreenAnimatedIcon">@drawable/icon_splash_screen_animated</item>
<item name="android:windowSplashScreenAnimationDuration">1000</item>Summary and Outlook
The migration covers all major Fluently Speaking apps, but Android 12 also introduces many other changes (location accuracy, app standby, foreground service restrictions, Bluetooth permissions, etc.). Android 13, released in August 2022, further tightens permissions and background limits. Overall, Google’s focus on security and stability benefits developers, and Fluently Speaking continues to prioritize user privacy and compliance.
Liulishuo Tech Team
Help everyone become a global citizen!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.