Integrate Adapty into your Android app with AI assistance
This guide helps you integrate Adapty into your Android app with the help of an LLM. You’ll start by preparing your Adapty dashboard, then work through each implementation stage by sending focused doc links to your LLM. At the end, you’ll find best practices for setting up your AI tools with Adapty documentation.
Copy this entire page as Markdown and paste it into your LLM to get started — click Copy for LLM at the top of the page or open the .md version. The LLM will use the guide links and checkpoints to walk you through each stage.
Before you start: dashboard checklist
Adapty requires dashboard configuration before you write any SDK code. Your LLM cannot look up dashboard values for you — you’ll need to provide them.
Required before coding
-
Connect your app store: In the Adapty Dashboard, go to App settings → General. This is required for purchases to work. Connect Google Play
-
Copy your Public SDK key: In the Adapty Dashboard, go to App settings → General, then find the API keys section. In code, this is the string you pass to the Adapty configuration builder.
-
Create at least one product: In the Adapty Dashboard, go to the Products page. You don’t reference products directly in code — Adapty delivers them through paywalls. Add products
-
Create a paywall and a placement: In the Adapty Dashboard, create a paywall on the Paywalls page, then assign it to a placement on the Placements page. In code, the placement ID is the string you pass to
Adapty.getPaywall("YOUR_PLACEMENT_ID"). Create paywall -
Set up access levels: In the Adapty Dashboard, configure per product on the Products page. In code, the string checked in
profile.accessLevels["premium"]?.isActive. The defaultpremiumaccess level works for most apps. If paying users get access to different features depending on the product (for example, abasicplan vs. aproplan), create additional access levels before you start coding.
Once you have all five, you’re ready to write code. Tell your LLM: “My Public SDK key is X, my placement ID is Y” so it can generate correct initialization and paywall-fetching code.
Set up when ready
These are not required to start coding, but you’ll want them as your integration matures:
- A/B tests: Configure on the Placements page. No code change needed. A/B tests
- Additional paywalls and placements: Add more
getPaywallcalls with different placement IDs. - Analytics integrations: Configure on the Integrations page. Setup varies by integration. See analytics integrations and attribution integrations.
Feed Adapty docs to your LLM
Use Context7 (recommended)
Context7 is an MCP server that gives your LLM direct access to up-to-date Adapty documentation. Your LLM fetches the right docs automatically based on what you ask — no manual URL pasting needed.
Context7 works with Cursor, Claude Code, Windsurf, and other MCP-compatible tools. To set it up, run:
npx ctx7 setup
This detects your editor and configures the Context7 server. For manual setup, see the Context7 GitHub repository.
Once configured, reference the Adapty library in your prompts:
Use the adaptyteam/adapty-docs library to look up how to install the Android SDK
Even though Context7 removes the need to paste doc links manually, the implementation order matters. Follow the implementation walkthrough below step by step to make sure everything works.
Use plain text docs
You can access any Adapty doc as plain text Markdown. Add .md to the end of its URL, or click Copy for LLM under the article title. For example: adapty-cursor-android.md.
Each stage in the implementation walkthrough below includes a “Send this to your LLM” block with .md links to paste.
For more documentation at once, see index files and platform-specific subsets below.
Implementation walkthrough
The rest of this guide walks through Adapty integration in implementation order. Each stage includes the docs to send to your LLM, what you should see when done, and common issues.
Plan your integration
Before jumping into code, ask your LLM to analyze your project and create an implementation plan. If your AI tool supports a planning mode (like Cursor’s or Claude Code’s plan mode), use it so the LLM can read both your project structure and the Adapty docs before writing any code.
Tell your LLM which approach you use for purchases — this affects the guides it should follow:
- Adapty Paywall Builder: You create paywalls in Adapty’s no-code builder, and the SDK renders them automatically.
- Manually created paywalls: You build your own paywall UI in code but still use Adapty to fetch products and handle purchases.
- Observer mode: You keep your existing purchase infrastructure and use Adapty only for analytics and integrations.
Not sure which one to pick? Read the comparison table in the quickstart.
Install and configure the SDK
Add the Adapty SDK dependency via Gradle in Android Studio and activate it with your Public SDK key. This is the foundation — nothing else works without it.
Guide: Install & configure Adapty SDK
Send this to your LLM:
Read these Adapty docs before writing code:
- https://adapty.io/docs/sdk-installation-android.md
Checkpoint
- Expected: App builds and runs. Logcat shows Adapty activation log.
- Gotcha: “Public API key is missing” → check you replaced the placeholder with your real key from App settings.
Show paywalls and handle purchases
Fetch a paywall by placement ID, display it, and handle purchase events. The guides you need depend on how you handle purchases.
Test each purchase in the sandbox as you go — don’t wait until the end. See Test purchases in sandbox for setup instructions.
Check subscription status
After a purchase, check the user profile for an active access level to gate premium content.
Guide: Check subscription status
Send this to your LLM:
Read these Adapty docs before writing code:
- https://adapty.io/docs/android-check-subscription-status.md
Checkpoint
- Expected: After a sandbox purchase,
profile.accessLevels["premium"]?.isActivereturnstrue. - Gotcha: Empty
accessLevelsafter purchase → check the product has an access level assigned in the dashboard.
Identify users
Link your app user accounts to Adapty profiles so purchases persist across devices.
Skip this step if your app has no authentication.
Guide: Identify users
Send this to your LLM:
Read these Adapty docs before writing code:
- https://adapty.io/docs/android-quickstart-identify.md
Checkpoint
- Expected: After calling
Adapty.identify("your-user-id"), the dashboard Profiles section shows your custom user ID. - Gotcha: Call
identifyafter activation but before fetching paywalls to avoid anonymous profile attribution.
Prepare for release
Once your integration works in the sandbox, walk through the release checklist to make sure everything is production-ready.
Guide: Release checklist
Send this to your LLM:
Read these Adapty docs before releasing:
- https://adapty.io/docs/release-checklist.md
Checkpoint
- Expected: All checklist items confirmed: store connection, server notifications, purchase flow, access level checks, and privacy requirements.
- Gotcha: Missing Google Play Real-Time Developer Notifications → configure them in App settings → Android SDK or events won’t appear in the dashboard.
Plain text doc index files
If you need to give your LLM broader context beyond individual pages, we host index files that list or combine all Adapty documentation:
llms.txt: Lists all pages with.mdlinks. An emerging standard for making websites accessible to LLMs. Note that for some AI agents (e.g., ChatGPT) you will need to downloadllms.txtand upload it to the chat as a file.llms-full.txt: The entire Adapty documentation site combined into a single file. Very large — use only when you need the full picture.- Android-specific
android-llms.txtandandroid-llms-full.txt: Platform-specific subsets that save tokens compared to the full site.