Skip to content

Android: run without Google Play services; UnifiedPush delivery - #6103

Merged
shai-almog merged 5 commits into
masterfrom
android-without-gms
Oct 25, 2026
Merged

shai-almog merged 5 commits into
masterfrom
android-without-gms

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Codename One apps now run on Android devices with no Google Play services: GrapheneOS, CalyxOS, /e/OS and LineageOS without Google apps. There's no build mode; the same APK checks at run time.

Changes

  • GoogleServices proxy. Every call into Play services, Play Core or Firebase goes through it, and it answers whether Play services is actually usable on the device. An outdated or updating Play services still counts as present, so nothing changes on Google devices.
  • Fallbacks:
    • Location uses the framework location manager, background updates and geofences included.
    • Google sign-in uses web OAuth.
    • In-app review, Nearby, Wear OS and Play Integrity report unsupported instead of hanging or showing the "Get Google Play services" prompt.
    • registerPush reports an error instead of never answering.
    • Fixes the inverted GNSS register/unregister.
  • UnifiedPush for PushClient apps. Turned on by the android.unifiedPush.vapidKey hint, or forced with android.messagingService=unifiedpush. A UnifiedPush endpoint is a Web Push subscription, sent as a cn1-web- device key, so the push server needs no change. The activity tries FCM, then Huawei Push Kit, then UnifiedPush.
  • Builder:
    • <queries> entries for Play services, the Play Store and HMS Core.
    • The startup FCM token fetch only runs when Play services is available.
    • Manifest entries for the new service and receiver.
    • The new hints are declared in the build-hint catalog.
  • Gate: scripts/check-android-gms-isolation.py, in its own workflow. Only the allow-listed proxies may name a Google Play type, and wildcard imports and string prefixes are caught too.
  • CI: the JDK 21 Android leg runs the device suite on the AOSP default image, which has no Google apps.
  • Docs: a developer guide chapter with a table of what works and what degrades without Play services.

No IAP changes.

Verification

  • Builder tests: 25 of 25 pass, 8 of them new.
  • SpotBugs reports 0 findings for the Android port and the build engine.
  • The UnifiedPush package compiles against connector 3.3.5 and API 37.
  • API-removal gate, build-hint checks, control-character check and Vale all pass.
  • The new gate fails on both negative cases.
  • Not yet run on a device without Play services; the new emulator leg is the first.

🤖 Generated with Claude Code

shai-almog and others added 2 commits October 25, 2026 12:36
De-Googled Android (GrapheneOS, CalyxOS, /e/OS, LineageOS without GApps)
is supported implicitly, with no build mode:

- GoogleServices proxies every Play services / Play Core / Firebase call
  behind isPlayServicesAvailable or isPlayStoreInstalled. Location, Google
  sign-in, in-app review, Nearby, Wear OS and Play Integrity now fall back
  or report unsupported instead of hanging or prompting for Play services.
- scripts/check-android-gms-isolation.py (own workflow) holds the port to
  that: only the allow-listed, guarded proxies may name a Google Play type.
- Framework location fallback for background updates and geofences
  (FrameworkLocationReceiver); fixes the inverted GNSS register/unregister.
- registerPush reports pushRegistrationError when no transport exists.
- UnifiedPush transport for PushClient apps (android.unifiedPush.vapidKey or
  android.messagingService=unifiedpush): endpoints are Web Push
  subscriptions sent as cn1-web- keys, so the push server needs no change.
  The activity tries FCM, then HMS, then UnifiedPush.
- Builder: <queries> for Play services and the Play Store, the startup FCM
  fetch guarded, hints declared in the catalog.
- The JDK 21 Android leg runs the device suite on an AOSP image without
  Google apps.
- Developer guide chapter with the feature matrix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Outdated or updating Play services counts as present (no regression on Google devices).
- <queries> names com.huawei.hwid when Push Kit is bundled.
- UnifiedPush endpoint rotation and unregistration persist while the app is not running.
- GMS gate also catches wildcard imports and qualified-name string prefixes.
- Docs note the framework location fallback on Google devices without Play location.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@shai-almog

shai-almog commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 227 screenshots: 227 matched.
✅ JavaScript-port screenshot tests passed.

@shai-almog

shai-almog commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 191 screenshots: 191 matched.

Native Android coverage

  • 📊 Line coverage: 18.90% (48251/255341 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 17.64% (229184/1299035), branch 12.04% (16818/139675), complexity 9.67% (12911/133466), method 14.57% (9122/62628), class 25.16% (1774/7052)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/625 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)
      • com.codename1.androidcompat.androidx.constraintlayout.core.widgets.com.codename1.androidcompat.androidx.constraintlayout.core.widgets.Flow – 0.00% (0/576 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 18.90% (48251/255341 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 17.64% (229184/1299035), branch 12.04% (16818/139675), complexity 9.67% (12911/133466), method 14.57% (9122/62628), class 25.16% (1774/7052)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6367 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/736 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/625 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)
      • com.codename1.androidcompat.androidx.constraintlayout.core.widgets.com.codename1.androidcompat.androidx.constraintlayout.core.widgets.Flow – 0.00% (0/576 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 170ms / native 63ms = 2.6x speedup
SIMD float-mul (64K x300) java 128ms / native 82ms = 1.5x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 77.000 ms
Base64 CN1 decode 69.000 ms
Base64 native encode 395.000 ms
Base64 encode ratio (CN1/native) 0.195x (80.5% faster)
Base64 native decode 245.000 ms
Base64 decode ratio (CN1/native) 0.282x (71.8% faster)
Image encode benchmark status skipped (SIMD unsupported)

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ✅ ByteCodeTranslator: 0 findings (no issues)
    • ✅ android: 0 findings (no issues)
    • ✅ android-compat: 0 findings (no issues)
    • ✅ android-res-compiler: 0 findings (no issues)
    • ✅ backend: 0 findings (no issues)
    • ✅ backend-test: 0 findings (no issues)
    • ✅ build-engine: 0 findings (no issues)
    • ✅ build-hint-catalog: 0 findings (no issues)
    • ✅ build-hint-tools: 0 findings (no issues)
    • ✅ codenameone-gradle-plugin: 0 findings (no issues)
    • ✅ codenameone-maven-plugin: 0 findings (no issues)
    • ✅ core-unittests: 0 findings (no issues)
    • ✅ desktop-compat-runtime: 0 findings (no issues)
    • ✅ fxml-compiler: 0 findings (no issues)
    • ✅ ios: 0 findings (no issues)
    • ✅ javac: 0 findings (no issues)
    • ✅ javafx-compat: 0 findings (no issues)
    • ✅ project-model: 0 findings (no issues)
    • ✅ swing-compat: 0 findings (no issues)
  • ✅ PMD: 0 findings (no issues) [Report archive]
  • ✅ Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

- Exclude the unifiedpush package from the NetBeans/Ant port compile too
  (nbproject/project.properties), as build.xml and the Maven pom do.
- Move the guide's build hint example into a docs/demos snippet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Flutter vs Codename One

Same application, built both ways: Flutter's AOT compile of the gallery, and the identical Dart source transpiled to Java on Codename One. Lower is better for every metric, so a ratio above 1.00x means Codename One is ahead by that factor.

android

9 interleaved rounds; host load 0.61, 1.7, 1.28

Metric Codename One Flutter Ratio Winner
Installed size 78.2 MB 95.8 MB 1.22x Codename One
Executable code 4.7 MB 20.6 MB 4.42x Codename One
Download size (zipped) 78.2 MB 95.8 MB 1.22x Codename One
Cold start to first frame on screen 334 ms 1296 ms 3.95x Codename One
Memory at rest 44.6 MB 78.4 MB 1.76x Codename One

Start-up and memory at rest are judged round by round: the ratio is the median of the per-round ratios, each from two launches made back to back, and the times and sizes shown are each side's median, so the ratio need not equal their quotient. Codename One was ahead in 9 of 9 rounds on cold start to first frame on screen; 9 of 9 rounds on memory at rest.

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

Workload Codename One Flutter Ratio
intArithmetic 59 ms 125 ms 2.12x
longArithmetic 36 ms 37 ms 1.03x
mathTranscendental 169 ms 208 ms 1.23x
arraySequential 17 ms 22 ms 1.29x
arrayRandom 194 ms 221 ms 1.14x
objectAllocation 58 ms 25 ms 0.43x
valueEscape 6 ms 5 ms 0.83x
hashMapChurn 105 ms 214 ms 2.04x
stringBuilding 59 ms 80 ms 1.36x
recursion 44 ms 179 ms 4.07x
quicksortBench 107 ms 121 ms 1.13x
Geometric mean 1.30x

Gate: within tolerance against scripts/flutter-bench/baseline.

Android sizes are for the arm64-v8a slice a phone is delivered, on both sides; Flutter's release apk carries three ABIs and would otherwise count its engine about three times.
Android start-up and memory come from an x86_64 emulator with a software GPU. They compare the two runtimes on one machine; they are not phone timings, and a renderer that leans on the GPU is penalised more there.
This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

javascript

9 interleaved rounds; host load 2.14, 1.27, 0.53

Metric Codename One Flutter Ratio Winner
Installed size 103.9 MB 122.5 MB 1.18x Codename One
Executable code 12.9 MB 25.2 MB 1.96x Codename One
Download size (zipped) 76.3 MB 84.1 MB 1.10x Codename One
Cold start to first frame on screen -- -- -- not measured
Memory at rest -- -- -- not measured

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

Workload Codename One Flutter Ratio
intArithmetic 524 ms wrong result Flutter: wrong result
longArithmetic 4017 ms did not run Flutter: did not run
mathTranscendental 267 ms did not run Flutter: did not run
arraySequential 134 ms 60 ms 0.45x
arrayRandom 645 ms wrong result Flutter: wrong result
objectAllocation 22 ms 16 ms 0.73x
valueEscape 85 ms 5 ms 0.06x
hashMapChurn 582 ms 163 ms 0.28x
stringBuilding 281 ms 68 ms 0.24x
recursion 288 ms 263 ms 0.91x
quicksortBench 282 ms wrong result Flutter: wrong result
Geometric mean 0.33x

Gate: within tolerance against scripts/flutter-bench/baseline; BEHIND FLUTTER on Compute (geomean of the VM workloads) (reported, not gated: a loss to Flutter on the web is currently accepted).

the JavaScript adapter needs a Chrome DevTools driver; sizes are reported and timings are not
This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

linux

9 interleaved rounds; host load 0.27, 2.79, 2.24

Metric Codename One Flutter Ratio Winner
Installed size 111.4 MB 143.8 MB 1.29x Codename One
Executable code 14.1 MB 16.1 MB 1.15x Codename One
Download size (zipped) 80.9 MB 92.9 MB 1.15x Codename One
Cold start to first frame on screen 125 ms 192 ms 1.55x Codename One
Memory at rest 85.8 MB 227.7 MB 2.68x Codename One

Start-up and memory at rest are judged round by round: the ratio is the median of the per-round ratios, each from two launches made back to back, and the times and sizes shown are each side's median, so the ratio need not equal their quotient. Codename One was ahead in 9 of 9 rounds on cold start to first frame on screen; 9 of 9 rounds on memory at rest.

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

Workload Codename One Flutter Ratio
intArithmetic 65 ms 160 ms 2.46x
longArithmetic 49 ms 50 ms 1.02x
mathTranscendental 185 ms 203 ms 1.10x
arraySequential 13 ms 30 ms 2.31x
arrayRandom 177 ms 190 ms 1.07x
objectAllocation 22 ms 28 ms 1.27x
valueEscape 4 ms 6 ms 1.50x
hashMapChurn 35 ms 270 ms 7.71x
stringBuilding 26 ms 85 ms 3.27x
recursion 68 ms 230 ms 3.38x
quicksortBench 121 ms 128 ms 1.06x
Geometric mean 1.90x

Gate: within tolerance against scripts/flutter-bench/baseline.

This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

windows

9 interleaved rounds

Metric Codename One Flutter Ratio Winner
Installed size 107.8 MB 121.1 MB 1.12x Codename One
Executable code 11.3 MB 14.1 MB 1.25x Codename One
Download size (zipped) 77.8 MB 86.4 MB 1.11x Codename One
Cold start to first frame on screen 110 ms 187 ms 1.65x Codename One
Memory at rest 58.5 MB 92.2 MB 1.58x Codename One

Start-up and memory at rest are judged round by round: the ratio is the median of the per-round ratios, each from two launches made back to back, and the times and sizes shown are each side's median, so the ratio need not equal their quotient. Codename One was ahead in 9 of 9 rounds on cold start to first frame on screen; 9 of 9 rounds on memory at rest.

Compute -- the VM workloads (vm/benchmarks), run inside each app; time is the best of the app's own repetitions, higher ratio means Codename One is faster.

Workload Codename One Flutter Ratio
intArithmetic 48 ms 122 ms 2.54x
longArithmetic 35 ms 35 ms 1.00x
mathTranscendental 134 ms 150 ms 1.12x
arraySequential 6 ms 21 ms 3.50x
arrayRandom 177 ms 204 ms 1.15x
objectAllocation 12 ms 20 ms 1.67x
valueEscape 0 ms 5 ms too fast to time
hashMapChurn 27 ms 209 ms 7.74x
stringBuilding 19 ms 72 ms 3.79x
recursion 120 ms 175 ms 1.46x
quicksortBench 110 ms 124 ms 1.13x
Geometric mean 1.98x

Gate: within tolerance against scripts/flutter-bench/baseline. Smaller than its baseline, which does not fail the gate: Executable code -10.80%; Download size (zipped) -0.78% -- rebaseline to tighten. To accept the move, download this platform's baseline-<platform>.json artifact and run python3 scripts/flutter-bench/flutter_baseline.py calibrate --pr 6103 --reason "<why these moved>" baseline-windows.json, then commit the overlay it writes.

This platform's adapter has not been exercised end to end before; treat the first published run as the thing under review.

Codename One wins 18 of 18 measured metrics across 4 platform(s).

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: No alerts found (report)
  • Paragraph capitalization: No paragraph capitalization issues (report)
  • LanguageTool: No grammar matches (report)
  • Image references: No unused images detected (report)

shai-almog and others added 2 commits October 25, 2026 14:50
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The AOSP default image uses 3-button navigation, which draws a grey bar over
the bottom 48px of every capture (and insets bottom sheets by its height), so
104 screenshots differed from the Google-image references while the app
rendered identically. Switch the emulator to gesture navigation before the
suite, as the google_apis image is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • ✅ Tests: 881 total, 0 failed, 55 skipped

Benchmark Results

  • Execution Time: 6770 ms

  • Hotspots (Top 20 sampled methods):

    • 10.13% java.lang.Object.hashCode (103 samples)
    • 8.55% com.codename1.tools.translator.BytecodeMethod.equals (87 samples)
    • 7.57% java.lang.System.identityHashCode (77 samples)
    • 5.60% com.codename1.tools.translator.IteratorEscape.mangle (57 samples)
    • 3.54% java.util.ArrayList.indexOf (36 samples)
    • 3.15% java.lang.StringBuilder.append (32 samples)
    • 2.16% com.codename1.tools.translator.BytecodeMethod.updateInlinableFieldDependencies (22 samples)
    • 1.97% com.codename1.tools.translator.JavascriptReachability.enqueueResolved (20 samples)
    • 1.87% com.codename1.tools.translator.Parser.cullMethods (19 samples)
    • 1.67% java.util.AbstractCollection.containsAll (17 samples)
    • 1.67% com.codename1.tools.translator.ByteCodeClass.hasDeclaredMethod (17 samples)
    • 1.47% com.codename1.tools.translator.NativeSymbolIndex.<init> (15 samples)
    • 1.28% com.codename1.tools.translator.IteratorEscape.ctorOnlyStoresParamsIntoThis (13 samples)
    • 1.18% com.codename1.tools.translator.ReachabilityCull.run (12 samples)
    • 1.18% com.codename1.tools.translator.BytecodeMethod.addToConstantPool (12 samples)
    • 1.18% java.io.FileOutputStream.writeBytes (12 samples)
    • 1.18% com.codename1.tools.translator.ByteCodeClass.markDependencies (12 samples)
    • 1.08% java.util.HashMap.putVal (11 samples)
    • 0.98% com.codename1.tools.translator.classfile.analysis.Frame.execute (10 samples)
    • 0.98% java.lang.String.equals (10 samples)
  • ⚠️ Coverage report not generated.

Static Analysis

  • ✅ SpotBugs: no findings (report was not generated by the build).
  • ⚠️ PMD report not generated.
  • ⚠️ Checkstyle report not generated.

Generated automatically by the PR CI workflow.

@shai-almog
shai-almog merged commit 354beb8 into master Oct 25, 2026
57 of 64 checks passed
@shai-almog
shai-almog deleted the android-without-gms branch October 25, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant