Getting Started with the Wildlink Android SDK
Overview
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 wild.link 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 wild.link:
- Add JitPack to an Android project
- Import the Wildlink Android SDK
- Create a wild.link
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 jitpack.io repository. We will use JitPack to import the Wildlink SDK binary.
maven { url "https://jitpack.io" }
See the highlighted rows in the following screenshot for how your file should look once these lines are 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:2.0.0.12"
Note: At the time of this writing, the most recent version of the SDK is 2.0.0.12. 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.

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 wild.link
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 wild.link immediately after the app starts. You would almost never create a wild.link 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 wild.link WildlinkBaseSdk.INSTANCE.createVanityUrl( "https://www.walmart.com/ip/VIZIO-24-Class-HD-720P-LED-TV-D24hn-G9/782959488", new VanityListener() { @Override public void onFailure(final ApiError apiError) { Log.d("DEBUG", "failure: " + apiError.getMessage()); } @Override 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.

Let’s take a look at what’s happening here:
- 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).
- Then, the createVanityUrl method is asking the Wildlink web service to create a wild.link (also known as a Vanity URL) from the original URL (https://www.walmart.com/ip/VIZIO-24-Class-HD-720P-LED-TV-D24hn-G9/782959488).
- In the callback, upon successful wild.link creation, we’re logging the returned wild.link 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 http://wild.link/walmart/AOvFCA
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 wild.link, 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.