Building App Extensions
equivalents on Android
(maybe?)
atsushieno
Slide 2
Slide 2 text
Extensibility
App Components that extends existing software, most likely written by others
Add(-)ins, Add(-)ons, Plug(-)ins, Extensions
Slide 3
Slide 3 text
Extensibility on mobiles
Apps are sandboxed and cannot simply load plugin code (library)
You can embed JS runtime etc. to get it around.
But it is not easy to get access to full platform features.
Slide 4
Slide 4 text
Plugins on iOS
App Extension
In macOS SDK / iOS SDK / *
https://developer.apple.com/app-extensions/
Slide 5
Slide 5 text
Android?
Android has Content Providers and Services since very beginning
Android 16 also introduced AppFunctionManager (build your own MCP alike maybe?)
https://developer.android.com/guide/components/intents-filters
Slide 6
Slide 6 text
GUI had not been extensible
Don't hijack over other app's UI!
Allowlisted technology: RemoteViews, widgets...
totally inflexible
Slide 7
Slide 7 text
SurfaceControlViewHost
kind of New since Android 11!
- Render arbitrary android.view.View onto host app's android.view.SurfaceView
- Host app indicates target SurfacePackage that performs rendering
- Under host's explicit agreement, there is no hijacking concern
Slide 8
Slide 8 text
Example
synth "plugin" UI (C++ native)
over Jetpack Compose host app
Slide 9
Slide 9 text
Example
Jetpack Compose synth plugin UI over C++ native host app
Slide 10
Slide 10 text
Resources
- API Reference
https://developer.android.com/reference/android/view/SurfaceControlViewHost
- TechBooster: INSIDE [技術のヒミツ] (Japanese book, 2023)
https://booth.pm/ja/items/5010062
- CommonsWare: A Peek at SurfaceControlViewHost in Android R
https://commonsware.com/blog/2020/03/27/peek-surfacecontrolviewhost-android-r.html
- my use case
https://github.com/atsushieno/aap-core/blob/531e3adf/androidaudioplugin/src/main/java/org/android
audioplugin/hosting/AudioPluginSurfaceControlClient.kt