Developer & AI Integration Docs

Adxiety Client SDK Integration Guide

Local attention-grant verification for Android. Current source examples require explicit environment initialization and a matching reviewed artifact; production trust remains unprovisioned.

SDK Network Permission0 (None)
Compiled DEXMeasured per build
Synchronous ReadsMemory only
Target AndroidAPI 26 – 36

1-Turn AI Coding Assistant Prompt

Optimized for Antigravity, Cursor, GitHub Copilot, and Claude. Paste directly into your chat.

# Adxiety SDK integration — current source contract
These are current E1 source API examples. Use only an E1-capable locally reviewed AAR whose full SHA-256 and provenance you verify. The frozen P2c consumer artifact lacks Adxiety.initialize; the obsolete bundled 1.0.0 AAR is also unsuitable. No public Maven release/download or provisioned Companion Play listing is established. Existing consumer-smoke compilation did not exercise initialize; external Kotlin/Java initializer coverage remains a pre-production gate. Production signer pins remain empty and fail closed.
One SDK artifact; explicitly initialize SANDBOX or LIVE before normal use. Same-environment repeat succeeds; a conflicting environment returns false without switching. Before initialization, SDK calls fail closed without IPC, observer registration, navigation or entitlement persistence mutation. Build/release safeguards remain separate; debug flags do not select an environment.
Keep host monetization policy explicit; no mandatory paid/attention waterfall. Do not add SDK networking or ad SDKs for this integration. Preserve cancellation and signed trust checks. Memory reads do not query disk or the companion; no universal latency or DEX-size guarantee is made.

## Dependencies
dependencies {
    // Placeholder filename: supply and hash-verify an E1-capable reviewed local AAR.
    // Frozen P2c bytes do NOT implement the initialization examples below.
    implementation(files("libs/adxiety-client-reviewed-e1-<sha12>.aar"))
    implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.22")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
    // Only if the HOST uses Dispatchers.Main (for example, Compose):
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
}

## Inspect merged manifest
<!-- Inspection excerpt, NOT a replacement for the full merged SDK manifest. -->
<queries>
    <package android:name="com.adxiety.companion.sandbox" />
    <package android:name="com.adxiety.companion" />
</queries>
<!-- Also verify merged com.adxiety.client.AdxietyReturnActivity and
     com.adxiety.action.HOST_APP against the actual reviewed AAR manifest.
     Keep manifest merging enabled; inspect the actual host variant output. -->

## Initialize, then read/refresh/renew
import android.content.Context
import com.adxiety.client.Adxiety
import com.adxiety.client.AdxietyClient
import com.adxiety.client.AdxietyEnvironment
import com.adxiety.client.model.AdxietyLeaseState

// Call at host startup with AdxietyEnvironment.SANDBOX or .LIVE chosen explicitly.
// No default, build-type inference or runtime switching. Never ignore false.
fun initializeAttention(applicationContext: Context, environment: AdxietyEnvironment): Boolean {
    if (!Adxiety.initialize(applicationContext, environment)) {
        return false // Keep attention access unavailable; do not navigate or refresh.
    }
    return true
}

// Caller invokes these only after initializeAttention returned true.
fun memoryAttentionState(context: Context): AdxietyLeaseState =
    AdxietyClient.getLeaseState(context) // Cold UNKNOWN is not proof of no entitlement.

// Call from a coroutine. SDK owns persistence/refresh dispatch; cancellation propagates.
suspend fun refreshAttentionState(context: Context): AdxietyLeaseState =
    AdxietyClient.getLeaseStateAsync(context)

// User action only; authenticates destination asynchronously. Opening UI earns nothing.
fun requestAttentionRenewal(context: Context) = AdxietyClient.launchRenewal(context)

## Optional Compose example (requires the host's existing Compose setup)
import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalContext
import com.adxiety.client.Adxiety
import com.adxiety.client.AdxietyClient
import com.adxiety.client.AdxietyEnvironment

@Composable
fun FeaturePassCard(environment: AdxietyEnvironment) {
    val context = LocalContext.current.applicationContext
    // Prefer host startup initialization. Same-environment repeat is safe.
    // The host must supply SANDBOX or LIVE; changing this argument cannot switch SDK state.
    val initialized = remember(context, environment) { Adxiety.initialize(context, environment) }
    if (!initialized) {
        Text("Attention access unavailable")
        return
    }
    val leaseFlow = remember(context) { AdxietyClient.observeLease(context) }
    val leaseState by leaseFlow.collectAsState(initial = AdxietyClient.getLeaseState(context))
    if (leaseState.isActive) {
        Text("Feature unlocked")
    } else {
        Button(onClick = { AdxietyClient.launchRenewal(context) }) {
            Text("Open companion renewal")
        }
    }
}

Observe semantic states, not a guaranteed countdown or real-time deadline. Scope collection to the host UI lifecycle. Discovery is not authentication or entitlement. Renewal may fail closed; no current public Play listing is promised. Voucher delivery requires the host's atomic deposit/receipt adapter; never add summary counters to a balance. See /llms-sdk.txt for the retained delivery contract.
Privacy wording must be reviewed against the entire host and companion, not treated as automatic compliance certification.

Using an Agentic AI Assistant? (Antigravity, Cursor, Claude Code, Copilot)

Our platform provides a dedicated assistant skill at .agents/skills/sdk_integrator/SKILL.md. It guides authorized dependency, trust and contract inspection. Generated examples still require artifact verification, host integration and the applicable independent reviews.

3-Step Quickstart for Android Developers

No API keys in your APK, no network initialization, no tracking manifests.

1

Add the SDK Dependency

These are current E1 source API examples. Use only an E1-capable locally reviewed AAR whose full SHA-256 and provenance you verify. The frozen P2c consumer artifact lacks Adxiety.initialize; the obsolete bundled 1.0.0 AAR is also unsuitable. No public Maven release/download or provisioned Companion Play listing is established. Existing consumer-smoke compilation did not exercise initialize; external Kotlin/Java initializer coverage remains a pre-production gate. Production signer pins remain empty and fail closed. Direct AAR files require explicit runtime dependencies. The filename below is a local placeholder, not a download coordinate:

dependencies {
    // Placeholder filename: supply and hash-verify an E1-capable reviewed local AAR.
    // Frozen P2c bytes do NOT implement the initialization examples below.
    implementation(files("libs/adxiety-client-reviewed-e1-<sha12>.aar"))
    implementation("org.jetbrains.kotlin:kotlin-stdlib:1.9.22")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
    // Only if the HOST uses Dispatchers.Main (for example, Compose):
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3")
}
2

Inspect Manifest Merging

Keep Gradle manifest merging enabled. Verify the selected AAR contributes both companion package queries and the reciprocal return Activity/action. This queries excerpt is not a complete manifest replacement:

<!-- Inspection excerpt, NOT a replacement for the full merged SDK manifest. -->
<queries>
    <package android:name="com.adxiety.companion.sandbox" />
    <package android:name="com.adxiety.companion" />
</queries>
<!-- Also verify merged com.adxiety.client.AdxietyReturnActivity and
     com.adxiety.action.HOST_APP against the actual reviewed AAR manifest.
     Keep manifest merging enabled; inspect the actual host variant output. -->
3

Verify Passes and Launch Renewals

Initialize explicitly with SANDBOX or LIVE and handle false before normal use. Memory-only reads can return UNKNOWN on cold start; use bounded asynchronous refresh or observation. Renewal is a user action via launchRenewal(context):

import android.content.Context
import com.adxiety.client.Adxiety
import com.adxiety.client.AdxietyClient
import com.adxiety.client.AdxietyEnvironment
import com.adxiety.client.model.AdxietyLeaseState

// Call at host startup with AdxietyEnvironment.SANDBOX or .LIVE chosen explicitly.
// No default, build-type inference or runtime switching. Never ignore false.
fun initializeAttention(applicationContext: Context, environment: AdxietyEnvironment): Boolean {
    if (!Adxiety.initialize(applicationContext, environment)) {
        return false // Keep attention access unavailable; do not navigate or refresh.
    }
    return true
}

// Caller invokes these only after initializeAttention returned true.
fun memoryAttentionState(context: Context): AdxietyLeaseState =
    AdxietyClient.getLeaseState(context) // Cold UNKNOWN is not proof of no entitlement.

// Call from a coroutine. SDK owns persistence/refresh dispatch; cancellation propagates.
suspend fun refreshAttentionState(context: Context): AdxietyLeaseState =
    AdxietyClient.getLeaseStateAsync(context)

// User action only; authenticates destination asynchronously. Opening UI earns nothing.
fun requestAttentionRenewal(context: Context) = AdxietyClient.launchRenewal(context)

Jetpack Compose Reactive Observation

Use AdxietyClient.observeLease(context) for shared semantic state and expiry updates. Collection lifetime follows the composable; choose host lifecycle scoping deliberately. This is not a countdown or a hard real-time delivery guarantee:

import androidx.compose.material3.Button
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalContext
import com.adxiety.client.Adxiety
import com.adxiety.client.AdxietyClient
import com.adxiety.client.AdxietyEnvironment

@Composable
fun FeaturePassCard(environment: AdxietyEnvironment) {
    val context = LocalContext.current.applicationContext
    // Prefer host startup initialization. Same-environment repeat is safe.
    // The host must supply SANDBOX or LIVE; changing this argument cannot switch SDK state.
    val initialized = remember(context, environment) { Adxiety.initialize(context, environment) }
    if (!initialized) {
        Text("Attention access unavailable")
        return
    }
    val leaseFlow = remember(context) { AdxietyClient.observeLease(context) }
    val leaseState by leaseFlow.collectAsState(initial = AdxietyClient.getLeaseState(context))
    if (leaseState.isActive) {
        Text("Feature unlocked")
    } else {
        Button(onClick = { AdxietyClient.launchRenewal(context) }) {
            Text("Open companion renewal")
        }
    }
}

Architecture & Core Invariants

The Zero-Permission Invariant

The Adxiety Client SDK will never declare or require android.permission.INTERNET. Memory reads are local; asynchronous refresh uses worker-owned disk access and authenticated ContentProvider IPC. The host may independently declare network permissions; no latency guarantee is implied.

Quarantined Ad Mediation

The SDK adds no ad SDK or mediation listeners to your app. Your other dependencies require their own audit. Adxiety advertising belongs in the separate [ad]mit companion app.

Stacking Energy & Offline Continuity

Users do not need to wait until a pass expires to renew. Early views additively stack up to your configured ceiling (e.g. 30 days). For participating apps, optional offline continuity reserves keep users from being shut out while off-grid.

Configuration Authority Boundary

The new portal workspace is implemented offline, not deployed or live-qualified. Google-authenticated private app details, icons/screenshots and Sandbox/Live configuration drafts are unverified. No Play access or ownership check is required to draft; website-code ownership verification is deferred until production activation and must establish app-to-website association. Drafts never authorize Companion testing, runtime trust or entitlements. Signed/versioned configuration authority is separate from delivery. Controlled local delivery and future companion fetch/cache remain gated implementation work; this SDK adds no dynamic portal/network dependency.

User Experience & Trust Guide

Curious what the renewal flow looks like for your end users? Inspect the consumer experience, privacy guarantees, and haptic chimes at adxiety.com/for-users . No provisioned public Companion Play listing is established. Planned packages are com.adxiety.companion.sandbox and com.adxiety.companion. A store fallback attempt is not evidence that a listing exists.

Selected Kotlin API Reference

MethodReturn TypeDescription
Adxiety.initialize(context, environment)BooleanRequired process-wide selection. No default. Same-environment repeat returns true; conflict returns false without side effects. Handle false before use.
isLeaseActive(context)BooleanMemory-only active-state check. False may mean UNKNOWN, not absence of entitlement.
getLeaseState(context)AdxietyLeaseStateEvaluates the current memory snapshot; cold/uninitialized reads return UNKNOWN/inactive without disk or IPC.
getLeaseStateAsync(context)suspend AdxietyLeaseStateShared worker: one executing, one queued, 32 waiters; 2,000 ms caller budget and 5,000 ms acceptance window. Cancellation propagates; these are policies, not Binder termination or latency guarantees.
observeLease(context)Flow<AdxietyLeaseState>Lazy shared Flow, bounded sessions/subscribers and local expiry delivery. Slow collectors receive latest semantic state; scheduling delays are possible.
leaseState.extrasBundleBounded optional diagnostic metadata. Never authorize access or credit amounts from extras; capabilities require signed active grant facts.
deliverVouchers(context, adapter, continuation?)suspend VoucherDeliverySummaryValidates vouchers, asks the host adapter to commit its balance and duplicate receipt in one transaction, then acknowledges. Retry explicitly; summary counters are not credits to add.
isAdxietyInstalled(context)BooleanSelected-environment package/provider discovery only. True does not authenticate; false can mean unavailable, not physical absence.
launchRenewal(context, forceSandbox?)UnitNonblocking authenticated destination resolution, with bounded admission. Untrusted/unavailable resolution fails closed. Confirmed absence may attempt a store route. A legacy UI hint neither selects environment nor authorizes earning.
Qualification Boundaries

Explicit Environments & Qualification

SANDBOX and LIVE are explicit SDK-owned selections, separate from Debug/Release and Play tracks. Source/JVM evidence is not device, production trust or ad-network qualification.

1. Explicit Initialization

Choose SANDBOX or LIVE before normal SDK use. No default or runtime switch exists. Release/build safeguards against accidental Sandbox selection remain a separate integration requirement.

2. Actual Earning Required

Normal startup does not seed demo entitlements. An unavailable ad is not a reward in either environment. Opening renewal UI cannot mint a pass; isolated synthetic test callbacks are not a shipping simulation mode.

3. Separate Vendor Qualification

Official Sandbox test-ad setup, privacy/onboarding, callback association, issuance and host economic isolation remain gated. Environment labels do not establish effective vendor test mode or guarantee traffic safety.

Trust Layers and Open Limits

Accepted checks are bounded and do not establish tamper-proof storage, trusted time or universal replay protection:

Environment and Package

Each selected environment maps to its own companion package, provider authority and trust policy. Debug/Release does not select it.

Provider and Grant Verification

Provider package/certificate authentication precedes grant-key enrollment. Signed grants bind the intended host package/certificate; APK signers and grant-signing keys are distinct.

Authenticated Cache Provenance

Private storage names avoid collisions but are not cryptographic isolation. Disk acceptance also requires the selected policy, enrolled provenance and signature/audience checks.

Unprovisioned Trust and Recovery

Production signer pins remain empty/fail-closed. Replay/revision, clock/restore and key-lifecycle qualification remain open; historical aliases are not trust evidence.

Client SDK Privacy & Architectural Declarations

Factual specifications of the [ad]xiety Client SDK for publisher store listings, compliance audits, and privacy disclosures.

Network Access0 (None)

No INTERNET permission

Ad ID (AAID)Not Requested

No AD_ID permission

Local StatePrivate verification

Fixed-code diagnostics available

SDK TransportLocal IPC

No SDK network requests

SDK Technical & Regulatory Declarations

Bounded Verification Data

The SDK processes package/certificate identity, signed entitlement records and private cache/enrollment state. Optional diagnostics emit fixed event codes, not raw grant or host identifiers.

Zero Third-Party Data Sharing

The Client SDK does not transmit or share any user, device, or usage data with ad networks, analytics brokers, or external servers.

No SDK Networking

The Client SDK manifest declares no network permissions (android.permission.INTERNET is not requested). The SDK implements no networking. Host permissions apply process-wide; absence from the SDK manifest does not disable networking in other host code.

Zero Embedded Ad SDKs

The Client SDK contains no ad mediation adapters, video players, or ad network libraries. All advertising execution is quarantined strictly within the external [ad]mit app.

Local Inter-Process Communication

All token verification and status queries execute entirely on-device via local Android ContentProvider IPC with cryptographic signature checks.

Host App Compliance Autonomy

The SDK operates as a standalone offline dependency. Host disclosures must account for the complete application, dependencies, local data flows and companion interaction. This guide is not blanket Data Safety certification.

Artifact Permission & R8 Inspection

Inspect the actual merged manifest and minified APK. The SDK adds no permissions; your host may declare its own. Shipped consumer rules were sufficient for the bounded P2c fixtures, not a universal optimization guarantee:

# Inspect output AND successful tool exit; a tool error is not an offline result.
aapt dump permissions app-release.apk
# Attribute merged permissions to the host/dependencies; INTERNET may be valid for the host.
# Compare matched host builds with/without the SDK using the same R8/build settings.
# Measure actual DEX contributions, including runtime dependencies, not AAR archive size.
# No numerical size or latency ceiling is established here.
# Inspect R8 outputs; do not add blanket keep or dontwarn rules.

SDK Disclosure Draft for Host Review

If you disclose third-party SDKs in your app's privacy policy, review and adapt this bounded draft against actual app behavior:

The Adxiety SDK verifies attention grants locally using memory, private cache/enrollment state and authenticated ContentProvider IPC with the selected Adxiety Companion. It adds no INTERNET or AD_ID permission and no ad-network SDK. Package/certificate identity and signed entitlement data are used for verification; optional fixed-code local diagnostics are available. This describes the SDK, not all host dependencies or the separate companion. Review the complete application's actual data flows and permissions before making privacy or Play Data Safety declarations.