{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["admonition"]},"redocly_category":"Activation","product_name":"Engage Studio","type":"markdown"},"seo":{"title":"Android SDK Integration for Mobile In-App Messaging","description":"Integrate the preview Engage Mobile SDK with an Android app to retrieve Modal, Banner, and Hosted Pages experiences from Realtime Personalization.","siteUrl":"https://docs.treasure.ai","image":"/assets/treasure-ai-social-preview.e6fefb35676f6da91c2d1bc783bd39e618e7af2b1ad3aa52a96ae69d72e700fe.b1bff462.png","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"android-sdk-integration-for-mobile-in-app-messaging","__idx":0},"children":["Android SDK Integration for Mobile In-App Messaging"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The preview Engage Mobile SDK connects an Android app to Engage Studio Mobile In-App Messaging. The app sends a trigger event with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["trackImmediately"]},"; the SDK requests an offer from Realtime Personalization and renders a supported message in an SDK-owned WebView."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning","name":"Preview"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The native SDK integration is in preview. APIs, artifact distribution, message payloads, and rendering behavior may change before general availability. Follow the release-specific SDK distribution instructions provided by Treasure AI."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"what-the-sdk-does","__idx":1},"children":["What the SDK Does"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Android SDK is a thin client. Realtime Personalization decides whether to return an experience; the SDK executes the returned decision."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Responsibility"},"children":["Responsibility"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Owner"},"children":["Owner"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Audience eligibility and delivery decisions"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Realtime Personalization"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Trigger event and app lifecycle timing"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Customer app"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Message selection from the response"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Modal and Banner WebView rendering"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Hosted Pages URL rendering"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["App-specific Deep Link routing"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Customer app"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["App-specific custom actions"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Customer app"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Campaign impression, click, and dismiss measurement"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["SDK"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"before-you-start","__idx":2},"children":["Before You Start"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Prepare the following values:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A write-only API key for your Treasure AI account."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A records endpoint for the account region."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A Personalization endpoint."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A Personalization token."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A database and table for trigger events."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["An event schema that identifies the screen or action that should trigger a message."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The preview artifact version and minimum Android version depend on the SDK build you receive. Confirm them with the release information that accompanies the preview artifact."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"install-the-sdk-module","__idx":3},"children":["Install the SDK Module"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The preview Android SDK ships as a single artifact:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["com.treasuredata:td-android-sdk"]}," — event collection, buffering, upload, Personalization requests, message models, and the WebView rendering layer for Mobile In-App Messaging and Hosted Pages."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Mobile In-App rendering is part of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td-android-sdk"]},". There is no separate rendering artifact and no rendering install step."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The preview artifact is published for internal development through the SDK team's distribution workflow. Confirm the repository and version before adding it to a customer application."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"quick-start","__idx":4},"children":["Quick Start"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Initialize the core SDK in your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Application"]}," class. Mobile In-App rendering is part of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td-android-sdk"]},", so no separate rendering install step is required."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"import com.treasuredata.android.TreasureData;\n\npublic final class App extends Application {\n    @Override\n    public void onCreate() {\n        super.onCreate();\n\n        TreasureData.initializeSharedInstance(\n            this,\n            \"<WRITE_ONLY_API_KEY>\",\n            \"https://<region>.records.in.treasuredata.com\"\n        );\n\n        TreasureData td = TreasureData.sharedInstance();\n        td.setDefaultDatabase(\"<DATABASE>\");\n        td.setDefaultTable(\"<EVENT_TABLE>\");\n        td.setPersonalizationEndpoint(\n            \"https://p13n-api.treasuredata.com\"\n        );\n        td.setPersonalizationToken(\"<PERSONALIZATION_TOKEN>\");\n        td.enableAutoAppendUniqId();\n    }\n}\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["trackImmediately"]}," when a screen or event that can trigger a message occurs:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"Map<String, Object> event = new HashMap<>();\nevent.put(\"event\", \"pageview\");\nevent.put(\"screen_name\", \"home\");\n\nTreasureData.sharedInstance().trackImmediately(event);\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["addEvent"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["uploadEvents"]}," continue to send ordinary events. They do not trigger a Mobile In-App Message."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"configure-the-core-apis","__idx":5},"children":["Configure the Core APIs"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"API or property"},"children":["API or property"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Purpose"},"children":["Purpose"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setPersonalizationEndpoint"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Endpoint used to request a message offer."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setPersonalizationToken"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Read credential used for Personalization. Keep it separate from the write API key."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setDefaultDatabase"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setDefaultTable"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Default destination used to build trigger requests and ordinary events."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["trackImmediately"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sends a trigger event and requests a message."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setProfileContext"]}," / ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["setProfileValue"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["JSON-serializable values exposed as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["window.TDContext"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TreasureData.setBridgeListener"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Receives app-specific ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoke"]}," callbacks."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["openUrl"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Displays a URL that the app already has, such as a URL from a push payload."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"message-flow","__idx":6},"children":["Message Flow"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The app calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["trackImmediately(event)"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The Treasure Data Android SDK sends the trigger event to Personalization."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Realtime Personalization returns an offer or no offer."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The Engage Android module selects one displayable message."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The SDK checks the one-message-at-a-time guard."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The SDK renders Modal, Banner, or Hosted Pages."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The app and message content handle the resulting interaction."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If no campaign matches, the SDK does not display anything. This is a normal result, not an error."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK selects a single displayable message from the response. If another message is already visible, the new message is not displayed."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"hosted-pages","__idx":7},"children":["Hosted Pages"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Hosted Pages is the customer-facing name for a campaign message whose content is loaded from a URL. The Android Engage module displays the URL in a full-screen WebView and injects the configured profile context."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use Hosted Pages for:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Coupon pages."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Stamp cards."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Lotteries and interactive promotions."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Surveys and forms."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Personalized campaign pages."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Hosted Pages does not use the Modal or Banner appearance settings. The hosted page is responsible for providing an appropriate way to leave the experience."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"campaign-delivered-hosted-pages","__idx":8},"children":["Campaign-Delivered Hosted Pages"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the app calls ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["trackImmediately"]}," and Realtime Personalization returns a Hosted Pages offer, the SDK has the campaign identity needed for campaign measurement."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"direct-url-display","__idx":9},"children":["Direct URL Display"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the app already has a URL, it can call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["openUrl"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"Map<String, Object> context = new HashMap<>();\ncontext.put(\"coupon_id\", \"abc123\");\n\nTreasureData.sharedInstance().openUrl(\n    \"https://example.com/coupon\",\n    context\n);\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is useful for the push-tap path. The URL is displayed in the SDK WebView, but it did not come from a campaign offer, so it does not produce campaign ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["impression"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["click"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dismiss"]}," records."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"handle-links-and-custom-actions","__idx":10},"children":["Handle Links and Custom Actions"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["TDEngageBridgeListener"]}," to receive custom ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoke"]}," actions from message content. Use the Core SDK link handler for app-owned URL navigation:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"public final class EngageClient implements TDEngageBridgeListener {\n    @Override\n    public void handleTDBridgeInvoke(\n        @NonNull String name,\n        @NonNull Map<String, Object> params\n    ) {\n        if (\"grantPoints\".equals(name)) {\n            // Check authentication, authorization, and parameter limits.\n        }\n    }\n}\n\nTreasureData td = TreasureData.sharedInstance();\ntd.setBridgeListener(new EngageClient());\ntd.setLinkHandler(url -> {\n    // Validate and route app-owned schemes here.\n    return false;\n});\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK does not interpret the action name or authorize the request. Treat the message content and every parameter as untrusted input. Keep the listener alive for as long as the app needs to receive callbacks."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"share-profile-context-with-message-content","__idx":11},"children":["Share Profile Context with Message Content"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set JSON-serializable values that the SDK injects into Modal, Banner, and Hosted Pages content as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["window.TDContext"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"Map<String, Object> context = new HashMap<>();\ncontext.put(\"member_tier\", \"gold\");\ncontext.put(\"points\", 1200);\n\nTreasureData.sharedInstance().setProfileContext(context);\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Follow these rules:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Use JSON-serializable values only."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set the context again after each app launch; it is not persisted by the SDK."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Clear or replace it when the signed-in customer changes."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Do not include API keys, tokens, passwords, or values that the Hosted Pages page should not see."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Pass large numeric identifiers as strings to avoid JavaScript precision loss."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"handle-screen-changes","__idx":12},"children":["Handle Screen Changes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Personalization request is asynchronous. A customer can leave the triggering screen before the response arrives. Use the host application's screen state to decide whether a returned offer is still appropriate to show."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The exact presentation-gate API is part of the preview contract and may change before general availability. Do not display a campaign over a screen that is no longer the screen that triggered the request."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"register-a-push-token","__idx":13},"children":["Register a Push Token"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Android SDK preview includes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["registerDeviceToken"]},". The app still obtains the FCM token and handles notification permission and notification receipt."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"@Override\npublic void onNewToken(String token) {\n    TreasureData.sharedInstance().registerDeviceToken(\n        token,\n        TDPushProvider.FCM,\n        \"device_tokens\"\n    );\n}\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK sends a device-token record and flushes it immediately. The preview record uses the following SDK fields:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"td_device_token\": \"<FCM_TOKEN>\",\n  \"td_push_provider\": \"fcm\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This preview record is separate from the sample ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token_register"]}," event schema in the existing Mobile Push documentation. Do not treat the two schemas as interchangeable until the canonical Push event contract is finalized."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The app remains responsible for:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Obtaining the FCM token."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Requesting notification permission."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Receiving and displaying the notification."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Handling notification taps."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Extracting a URL from a Push payload and passing it to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["openUrl"]}," when the tap should open a Hosted Pages."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"measurement","__idx":14},"children":["Measurement"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the preview SDK flow, campaign measurement is recorded automatically for campaign-delivered messages:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["impression"]}," — the experience is presented."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["click"]}," — a supported link or bridge action is used."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["dismiss"]}," — the experience is closed."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["enableAutoAppendUniqId()"]}," is effectively required when you need to associate these records with an installation. The measurement destination and schema may change before general availability."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For troubleshooting, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/marketing-cloud/engage-studio/channels/mobile-inapp/troubleshooting"},"children":["Mobile In-App Troubleshooting"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"minimal-integration-checklist","__idx":15},"children":["Minimal Integration Checklist"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can integrate the preview SDK without using a sample application repository."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Add the preview ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td-android-sdk"]}," artifact through the distribution method provided with your SDK build."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Initialize the core SDK once in the application lifecycle."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Set the Personalization endpoint, token, database, and event table."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Configure profile context and the bridge listener only when your content needs them."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Call ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["trackImmediately"]}," when the configured screen or event occurs."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Test Modal, Banner, and Hosted Pages on supported Android devices."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Register FCM tokens separately if the app uses Mobile Push."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Verify impression, click, dismiss, Deep Link, and Hosted Pages behavior before release."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The preview artifact names, version, minimum Android version, and distribution URL are release-specific. Use the installation instructions that accompany the artifact rather than a source repository URL."]}]},"headings":[{"value":"Android SDK Integration for Mobile In-App Messaging","id":"android-sdk-integration-for-mobile-in-app-messaging","depth":1},{"value":"What the SDK Does","id":"what-the-sdk-does","depth":2},{"value":"Before You Start","id":"before-you-start","depth":2},{"value":"Install the SDK Module","id":"install-the-sdk-module","depth":2},{"value":"Quick Start","id":"quick-start","depth":2},{"value":"Configure the Core APIs","id":"configure-the-core-apis","depth":2},{"value":"Message Flow","id":"message-flow","depth":2},{"value":"Hosted Pages","id":"hosted-pages","depth":2},{"value":"Campaign-Delivered Hosted Pages","id":"campaign-delivered-hosted-pages","depth":3},{"value":"Direct URL Display","id":"direct-url-display","depth":3},{"value":"Handle Links and Custom Actions","id":"handle-links-and-custom-actions","depth":2},{"value":"Share Profile Context with Message Content","id":"share-profile-context-with-message-content","depth":2},{"value":"Handle Screen Changes","id":"handle-screen-changes","depth":2},{"value":"Register a Push Token","id":"register-a-push-token","depth":2},{"value":"Measurement","id":"measurement","depth":2},{"value":"Minimal Integration Checklist","id":"minimal-integration-checklist","depth":2}],"frontmatter":{"seo":{"title":"Android SDK Integration for Mobile In-App Messaging","description":"Integrate the preview Engage Mobile SDK with an Android app to retrieve Modal, Banner, and Hosted Pages experiences from Realtime Personalization."}},"lastModified":"2026-09-28T04:12:49.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/marketing-cloud/engage-studio/channels/mobile-inapp/developer-guide-android","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}