Android
Platform guide for the Miniwall Android SDK, covering requirements, Play Billing, Compose, Views and lifecycle.
The Android SDK is the library com.miniwall:sdk. It draws screens with Jetpack Compose and needs Android 7.0 (API 24) or later. Installation shows how to add it and call configure.
Everything in the other Mobile SDK pages applies. This page collects what is specific to Android.
Calls at a glance
| What | Call |
|---|---|
| Set up | Miniwall.configure(context, apiKey, options) in Application.onCreate |
| Show a screen | Miniwall.present(activity, source, options) (suspend), or with a callback for Java |
| Embed a screen | MiniwallScreen(source, options, modifier, onFinish) (composable) |
| Load ahead | Miniwall.preload(placements) (suspend) |
| Auto placements | Miniwall.startAutoPlacements(onResult, options), Miniwall.track(event) |
| Attributes | Miniwall.setAttributes(map) |
| After an outside purchase | Miniwall.reportPurchase(packageId, paywallId) |
| Forget the user | Miniwall.reset(placements) |
| Package IDs of a screen | Miniwall.packageIds(paywallJson) |
present needs a live Activity. Call it from a coroutine, for example lifecycleScope.launch. If the coroutine is cancelled, the screen closes.
Display
Popups, slide-ins and full-screen covers open in MiniwallActivity, a translucent activity the library declares in its manifest. Banners and toasts are added over your activity's content. See Display modes. The system back button closes an open sheet inside the screen first, then the screen.
Play Billing
The SDK does not depend on Play Billing. Map your ProductDetails to ProductInfo and run the billing flow in onPurchase. See Purchases and prices.
Views and Java
MiniwallScreen is a composable. In a View-based app, host it in a ComposeView. Miniwall.present(activity, source, options) { result -> ... } takes a callback and works from Java.
Auto placements and the lifecycle
Auto placements follow your activities: an open is counted when the first activity starts after the app was in the background. The screen is presented over the activity that is resumed at that moment. See Auto placements.