How Can We Help?
< Back
You are here:

Getting Started with the Wildlink Android SDK


In this guide we will:

  • Review why you might want to integrate the Wildlink Android SDK
  • Import the Wildlink SDK into a new Android project
  • Create an arbitrary from a retail URL

What is the Wildlink Android SDK and Why Should I Care?

Wildlink is a platform that allows you to monetize references to brands and products from thousands of online retailers in dozens of categories.  By using the Wildlink Android SDK, you can monetize the content of your app.  Examples where you may want to monetize your content include:

  • A forum/discussion board app where your users discuss products
  • A blogging app where users review products that they’ve purchased
  • A chat application where users share links to products
  • A clipboard helper application that converts links as they’re copied

Wildlink makes it easy to take this latent content that you’ve created or that your users have created and monetize it as an alternative (or complement) to traditional display ad revenue.

You as the app publisher can choose to then share some of the revenue with your users or keep it for yourself.

Importing the Wildlink SDK into a new Android project

Now that you understand the value of the Wildlink service, let’s make an example app that demonstrates how easy it is to get started.  There’s just three steps to creating your first

  1. Add JitPack to an Android project
  2. Import the Wildlink Android SDK
  3. Create a

1. Add JitPack to an Android project

Let’s start by creating a brand new Android project (either with or without Kotlin support).  Keep in mind that the minimum supported Android API level is 19 (4.4/KitKat).

We need to tell our project how to get the Wildlink SDK, so first, let’s open build.gradle (Project) and add a reference to the repository. We will use JitPack to import the Wildlink SDK binary.

maven {
    url ""

See the highlighted rows in the following screenshot for how your file should look once these lines are added.

build.gradle with jitpack repository added

2. Import the Wildlink SDK

Next, in your build.gradle (Module: app), add the following line to include the Wildlink SDK in your dependencies:

implementation "com.github.wildlink:wildlinkbasesdk:"

Note: At the time of this writing, the most recent version of the SDK is  You should always reference the latest stable release of this SDK, so change the version reference in this line as needed.

Once added, your build.gradle should look like the following screenshot.

build.gradle with Wildlink SDK dependency added

At this point, you’ll need to sync your gradle project using the “Sync Now” link at the upper right area of Android Studio.  This will download the Wildlink SDK dependency from JitPack and add it to your project.

3. Create a

Now that we have the Wildlink SDK imported into our project, we’re ready to make use of it.  For this demonstration, we’ll describe a VERY trivial example of creating a immediately after the app starts.  You would almost never create a on an application’s start-up since the point of Wildlink is to convert some content in the context of its creation or presentation (i.e. when a user composes a message).

But enough prefacing, let’s try get started!  Add the following to your main, default Activity in the onCreate method:

        // connect to the Wildlink service and create a device if we haven't before
        WildlinkBaseSdk.INSTANCE.init(this, null,"YOUR_APP_ID","YOUR_APP_SECRET"); // add this line if you want to monitor the clipboard

        // async call to create a
            new VanityListener() {

                public void onFailure(final ApiError apiError) {
                    Log.d("DEBUG", "failure: " + apiError.getMessage());

                public void onSuccess(final Vanity vanity) {
                    Log.d("DEBUG", "success: " + vanity.getShortUrl());

Note: Replace the YOUR_APP_ID and YOUR_APP_SECRET with the credential values that Wildfire has provided to you. with added Wildlink init and creation request

Let’s take a look at what’s happening here:

  1. The init call is taking your application-specific credentials and making a connection to the Wildlink web service.  It’s also storing some of the auth data for you as a convenience.  Behind the scenes, if this is the first time the SDK is running in this app on this device, it’s creating a device with Wildlink and storing the returned Device ID and Device Key.  It’s also generating a Device Token and storing it so that subsequent requests are all made in the same device context.  You never need to worry about handling the Device Token but you SHOULD store the Device ID and Device Key (more on this in the note below).
  2. Then, the createVanityUrl method is asking the Wildlink web service to create a (also known as a Vanity URL) from the original URL (
  3. In the callback, upon successful creation, we’re logging the returned to debug (so you can view it in Logcat).  Running the app now should show you a line that looks like this in Logcat:
2018-12-05 15:43:41.863 7330-7394/com.example.mylappy.myapplication D/DEBUG: success

Note: We mentioned that behind the scenes, the SDK is creating a device with the Wildlink platform. It’s important that you take the generated Device ID and Device Key and store it somewhere centrally (i.e. a database on your server) so that you can later address this device (i.e. to restore a device after reinstallation of your app) or reference commission data for this device (i.e. for support requests).

TODO need to describe the methods for how to access the Device ID and Device Key

Next Steps

Now that you’ve created your first, check out what else you can do with the SDK by visiting the wildlinkbasesdk Github project.  You can also find the lower-level API reference complete with Postman templates for testing in the REST API docs.

Table of Contents