The Android SDK is built around the AppActor singleton object. Configure it once from application startup, then keep Activity usage limited to the actual purchase call.

Configure from app startup

Important rules:
  • configure from your application or main-process startup path
  • configure(...) is a suspend API, so call it from a coroutine or lifecycle-aware scope
  • do not treat configure as a cheap per-screen init
  • keep Activity references for purchase(...), not for general reads

Identity surfaces

  • appUserId
  • isAnonymous
  • logIn(appUserId)
  • logOut()
  • reset()
Use appUserId during configure if you already know the account. Otherwise let AppActor start anonymously and attach later with logIn(...). logOut() is a local-only transition back to an anonymous runtime. It throws if the current user is already anonymous, so do not treat it as an idempotent backend logout call. reset() is much stronger than logout. It tears down the runtime and clears persisted SDK state, caches, and local recovery artifacts. Keep it for testing, deliberate local wipes, or wrapper restarts, not normal account sign-out.

Live state and callbacks

Android exposes both direct state and reactive hooks:
  • customerInfo
  • customerInfoFlow
  • onCustomerInfoChanged
  • onReceiptPipelineEvent
  • onDeferredPurchaseResolved
That means Kotlin apps can stay in coroutine or flow style, while older code can still use callbacks.

Startup behaviors to keep in mind

  • configure establishes local identity immediately and then completes bootstrap work
  • receipt and attribute flushing also participate in lifecycle maintenance
  • if you want Install Referrer, enable it after configure, not before

Java and wrapper surfaces

AppActorJava exists for Java-friendly async callbacks. AppActorBridge exists for hybrid wrappers and bridge integrations. New Kotlin-first app code should normally stay on AppActor unless you specifically need one of those compatibility layers.