Sample App
Overview
OneTrust provides a demo app that teams can use as a reference to see how the SDK works and how to set it up. To download the demo app, follow these steps.
Launching the demo app
- Unzip the file downloaded above
- In Android Studio, open the OTPublishersNativeApp folder
Mobile Android
- Run the app
- Once the demo app is running, you'll be greeted with a Settings page that looks like this:
![](https://cdn.onetrust.com/images/dev-portal/sdk/mobile/android/sdk-mobile-apps-android-simulator.png)
- Complete the fields, as follows:
Field | Description | Optional? |
---|---|---|
Domain URL | CDN location for the SDK data. You can find this information in your tenant > Mobile App Consent > SDKs > Your App > Instructions. See examples below. | No |
Domain ID | Application ID for your app. You can find this information in your tenant > Mobile App Consent > SDKs > Your App > Instructions. | No |
Language | Enter your two-letter or four-letter ISO language code. For example, en or en-GB for English. | No |
Country Code | Two-letter ISO country code. For example,US for United States or FR for France, etc. | Yes |
Region Code | Two-letter ISO region code most commonly used for US states like CA for California. | Yes |
Data Subject Identifier | Data subject identifier used to store a user's consent profile in OneTrust for metrics, reporting, audit, and cross device profile syncing. If no ID is specified, the SDK generates a random GUID. | Yes |
Environment | Domain URL to Use |
---|---|
app.cookiepro.com | cookie-cdn.cookiepro.com |
app-uk.onetrust.com | cdn-ukwest.onetrust.com |
app-au.onetrust.com | cdn-au.onetrust.com |
app-apac.onetrust.com | cdn-apac.onetrust.com |
app.onetrust.com | cdn.cookielaw.org |
app-de.onetrust.com | cdn.cookielaw.org |
app-eu.onetrust.com | cdn.cookielaw.org |
trial.onetrust.com | cdn.cookielaw.org |
uat.onetrust.com | cdn.cookielaw.org |
uat-de.onetrust.com | cdn.cookielaw.org |
- Click the Download SDK Data button
- Tap the Home button to head to the main page
![](https://cdn.onetrust.com/images/dev-portal/sdk/mobile/android/sdk-mobile-apps-android-simulator-home.png)
Android TV
- Open the
RenderTVUIActivity
class in the sample app - Set the
cdnLocation
,domainId
andlanguage
values
private static final String cdnLocation = "paste_cdn_location_of_your_app_here";
private static final String domainId = "paste_appId_of_your_app_here";
private static final String language = "en";
- Run the app
Updated 9 months ago