Documentation

​
​

Development

User Acquisition

Monetization

Industry

Unity Offerwall

Offerwall Android SDK

Offerwall iOS SDK

Offerwall Unity SDK

Unity Offerwall

Tapjoy Offerwall
​
​
Introduction
  • Quickstart
  • Manual integration
  • Changelog
  • Update guide
  • SDK reference
  • Offerwall migration checklist
Placements
  • Virtual currency
  • SDK
  • Offerwall migration guide
Testing
  • Test devices
  • Examples
Advanced
  • User privacy
  • Reducing total method count
  • Proguard
  • User properties
Cocos2dx
  • C++ library
  • C++ API reference
  1. Grow your game
  2. Unity Offerwall
  3. Android SDK

Manual integration

Integrate the Tapjoy Android SDK manually by downloading the .aar file, adding it to your project’s libs folder, and updating your Gradle dependencies with Tapjoy and Google Play Services.
Read time 5 minutes
Last updated 3 months ago

Download SDK

The first step in integrating the SDK manually is to download the Android SDK itself.

Add the SDK to your project

After unzipping the SDK, you will find docs, libraries and the TapjoyEasyApp.
  1. Copy the
    tapjoyconnectlibrary.aar
    file to your project’s /lib folder (if you don’t have it, create the folder first)
  2. Add Tapjoy to your application’s build.gradle:
dependencies { implementation files('libs/tapjoyconnectlibrary.aar') }
  1. Add Google Play Services to your build.gradle:
repositories { maven { url 'https://maven.google.com/' name 'Google' }}
dependencies { implementation 'com.google.android.gms:play-services-ads-identifier:17.1.0'}

Add app permissions and activities

The following permissions are needed:
  • ACCESS_WIFI_STATE
    (optional)

AD_ID and the Google Play Families program

play-services-ads
v17.1.0 includes the
AD_ID
permission which must be removed for members of the Google Play Families Program.
You can exclude the permission by adding the following element to your manifest:
<uses-permission android:name="com.google.android.gms.permission.AD_ID" tools:node="remove"/>
For more information, refer to the Play Console Help documentation on Advertising ID.

JAR integration

If you are using the JAR option instead of the AAR, the following permissions and activities are also necessary.
  • INTERNET
  • ACCESS_NETWORK_STATE
<uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
To use Tapjoy’s full functionality for the current SDK version, add these activities to the
AndroidManifest.xml
file in the Application block:
<activity android:name="com.tapjoy.TJAdUnitActivity" android:configChanges="orientation|keyboardHidden|screenSize|uiMode" android:theme="@style/TranslucentTheme" android:enableOnBackInvokedCallback="true" android:hardwareAccelerated="true" tools:ignore="UnusedAttribute" /><activity android:name="com.tapjoy.TJWebViewActivity" android:configChanges="orientation|keyboardHidden|screenSize|uiMode" android:theme="@style/TranslucentTheme" android:enableOnBackInvokedCallback="true" android:hardwareAccelerated="true" tools:ignore="UnusedAttribute" />
You will also need to add the same configChanges to your App’s Manifest activity:
android:configChanges="orientation|keyboardHidden|screenSize|uiMode"
At this point, it’s a good idea to compile and run your application to ensure that everything in your app is still working. Because we haven’t actually done anything to your application’s code, there should be no errors or changes in how your application functions.

Connect to Tapjoy

The next step is to add the Tapjoy connect code to your application. This key bit of code "turns on" the Offerwall SDK in your application.
Note
The Tapjoy connect call is extremely important because no Tapjoy products or functionality will work if it is not implemented correctly.
To implement the Tapjoy connect call, you will need your Offerwall SDK Key for the application you are integrating. To find this, navigate to your application in the Tapjoy dashboard, and select the "Settings" button on the top navigation bar. Navigate to "App Settings" and you will find the SDK Key at the bottom of the page.
Now it's time to write some code. Import Tapjoy in to your Activity:
import com.tapjoy.Tapjoy
Then in your main Activity's
onCreate()
method connect to Tapjoy:
Hashtable<String, Object> connectFlags = new Hashtable<String, Object>(); connectFlags.put(TapjoyConnectFlag.TJC_OPTION_LOGGING_LEVEL, TJLogLevel.DEBUG); // Disable this in production builds connectFlags.put(TapjoyConnectFlag.USER_ID, "USER_ID_GOES_HERE"); // Important for self-managed currency Tapjoy.connect(getApplicationContext(), "SDK_KEY_GOES_HERE", connectFlags, new TJConnectListener() { @Override public void onConnectSuccess() { } @Override public void onConnectWarning(int code, String message) { } @Override public void onConnectFailure() { } });
In this code you can see that we connect to Tapjoy (listening for the success, failure, and warning callbacks) and we configure two 'connect flags' (logging and user id).
onConnectSuccess
indicates the SDK has successfully connected to the Tapjoy servers. If we connect successfully but there is a non-blocking issue
onConnectWarning
will fire first. Currently this feature will only detect issues with UserId when sent in ConnectFlags. If we cannot connect to the servers successfully,
onConnectFailure
will fire.
The two most common and useful connect flags for Publishers are ENABLE_LOGGING and USER_ID.
You will use the logging flag in your debug builds but it is important to disable when you are building for production.
Setting the USER_ID flag is crucial when you are using a self-managed currency. Setting it at connect is important as it ensures it is set before any placement is called, preventing potential rewarding issues.
Some other connect flags that are useful to help publishers control how Tapjoy uses the various Android Identifiers supplied by the operating system:

Flag

Description

Notes

ALLOW_LEGACY_ID_FALLBACK
If this flag is set, the Offerwall SDK will use persistent IDs for advertising purposes if the advertising ID is not available.Available in SDK versions 12.2.1 and later.
DISABLE_ADVERTISING_ID_CHECK
By default, Tapjoy’s Android SDK checks for the existence of the Google Advertising Identifier and will fail to initialize if it does not find it. By setting this flag, you can disable this check so that the Offerwall SDK initializes even if there is no Google Advertising Identifier present.This is useful when Google Play Services is not present in the app, such as when you are making a build for release in a non-Google Play app store.
For an explanation of all connect flags, refer to the Java SDK Reference.
Now compile and run your application.
In the Tapjoy Dashboard, if you select Analytics from the top navigation bar and then "Real-time" tab in the navigation bar on the left, activity from your application will display soon after you run it.

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • Download SDK

    • Add the SDK to your project

      • Add app permissions and activities

        • AD_ID and the Google Play Families program

        • JAR integration

    • Connect to Tapjoy


Report a problem with this page