Newsroom for Android

Step 1: Install the SDK

The latest version is 2.4.0

Add Taboola library and its dependency to your project

implementation 'com.taboola:android-sdk:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'

Step 2: Verify the AndroidManifest.xml

Include this line in your app’s AndroidManifest.xml to allow Internet access and read the network state

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

Step 3: Set Proguard rules

###---------- Begin: proguard configuration for Taboola SDK API  ----------
-keepnames class
-keep class** {*;}
###---------- End: proguard configuration for Taboola API  ----------

#### All of the rules below are for Taboola API dependencies. You don't have to modify them

###--------------- Begin: proguard configuration for Gson ----------
# Gson uses generic type information stored in a class file when working with fields. Proguard
# removes such information by default, so configure it to keep all of it.
-keepattributes Signature

# For using GSON @Expose annotation
-keepattributes *Annotation*

# Gson specific classes
-dontwarn sun.misc.**
#-keep class** { *; }

-keepattributes EnclosingMethod

# Application classes that will be serialized/deserialized over Gson
-keep class** { *; }

# Prevent proguard from stripping interface information from TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements
-keep class * implements
-keep class * implements

###--------------- End: proguard configuration for Gson ----------

Step 4: Init the SDK

A. Create PublisherInfo

PublisherInfo publisherInfo = new PublisherInfo(<MyPublisherId>).setApiKey(<myApiKey>);
  • MyPublisherId - Your publisher ID as provided to you by Taboola account manager
  • MyApiKey - Your API key as provided to you by Taboola account manager

B. Call Taboola init with your publisher info


Step 5: Report a Newsroom event

Use the reportTaboolaEvent to send an event to the Newsroom platform

Map<String, String> data = new HashMap<>();
Taboola.reportTaboolaEvent(EventType.NEWSROOM, data)

Example of data HashMap

Map < String, String > data = new HashMap < > ();
  data.put("user_type", "subscriber");
  data.put("dashboard", "home-app");
  data.put("region_id", "test");
  data.put("region_index", "1");
  data.put("url", "");
  data.put("title", "test title");
  data.put("thumbnail_url", "");
  data.put("premium_content", "true");
Taboola.reportTaboolaEvent(EventType.NEWSROOM, data);


What is your data string?

Please contact your Newsroom account manager for the exact event details you need to send

You're done!

You have successfully shared events from your native app into Newsroom platform

Updated about a year ago

Newsroom for Android

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.