myChips SDK
  • Introduction
  • Getting Started
    • Create a Publisher Account
    • Create your App/Site
    • Create an AdUnit
    • Test in Sanbox mode
  • Reward Handling
    • Webhook S2S Postback
    • Validating the Webhook S2S
    • Rejected S2S Webhook Postback
    • IAP S2S Webhook Postback
  • Billing
  • Unity
    • Install SDK
    • Reward User
    • FAQ
  • Android
    • Install SDK
    • Reward User
  • React Native
    • Install SDK
    • Reward User
  • RN Expo
    • Install SDK
    • Reward User
  • iOS
    • Install SDK
    • Reward User
  • Flutter
    • Install SDK
    • Reward User
  • iFrame
  • WebView & Direct Link
  • Revenue API
Powered by GitBook
On this page
  • 1. Introduction
  • 2. Prerequisites
  • 3. SDK Integration
  • 4. Initializing the SDK
  • 5. Display the Offerwall
  1. Android

Install SDK

1. Introduction

This guide provides a comprehensive walkthrough for integrating the MyChips SDK into your Android application, enabling the display of an engaging offerwall.

2. Prerequisites

  • Android Studio

  • Minimum version requirement 27.

3. SDK Integration

3.1 Adding the SDK

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        maven {
            url = uri("https://europe-west1-maven.pkg.dev/mychips-b31fe/mychips-android-sdk")
        }
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven("https://europe-west1-maven.pkg.dev/mychips-b31fe/mychips-android-sdk")
    }
}

For Kotlin DSL Projects: In your project-level setting.gradle.kts

For Groovy-Based Projects: In your project-level build.gradle

3.2 Adding the SDK Dependency to App-Level Build File

In your app-level build.gradle(Module :app) file, add the following dependency

dependencies { 
  implementation("io.mychips:offerwall:+") 
  // Other dependencies...
}
dependencies {
 implementation 'io.mychips:offerwall:+' 
 // Other dependencies... 
}

3.3 Configuring the Android Manifest

In your AndroidManifest.xml, add the following:

Permission for Internet Access:

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

Activity Declaration:

<activity android:name="io.mychips.offerwall.controller.MCOfferwallActivity"
            android:theme="@style/Theme.AppCompat.NoActionBar"/>

4. Initializing the SDK

In your main activity’s onCreate method, import and initialize the SDK:

import io.mychips.offerwall.MCOfferwallSDK
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        // Replace 'YOUR_API_KEY'
        MCOfferwallSDK.Init(this, "YOUR_API_KEY") 
        
    }
}

import io.mychips.offerwall.sdk.MCOfferwallSDK;
// ...public class MainActivity extends AppCompatActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Replace 'YOUR_API_KEY' 
        MCOfferwallSDK.Init(this,"YOUR_API_KEY");
        
    }
}

Obtain your API key and User ID from Universal Developer Portal

4.1 (Optional) Set userId if you have your own unique id

  MCOfferwallSDK.SetUserId("HERE YOUR USER ID");

Replace "HERE YOUR USER ID" with your actual user ID variable or value.

If you do not provide a specific user ID, one will be automatically generated.

4.2 (Optional) Set Google AdvertisingId

Improve the reward tracking by passing the advertinsing id. Official documentation

  MCOfferwallSDK.SetAdvertisingId("HERE YOUR Google Advertising ID");

5. Display the Offerwall

Replace ‘AD_UNIT_ID’ with your actual Ad unit ID.

In your main activity’s onCreate method, import and initialize the SDK:

val mc = MCOfferwallController(this)
mc.Show("AD_UNIT_ID")
MCOfferwallController mc = new MCOfferwallController(this);
mc.Show("AD_UNIT_ID");

Your Ad unit ID can be found at link

PreviousAndroidNextReward User

Last updated 5 months ago