Integrate and Display the Start.io (StartApp) Ads in your Mobile Application

Integrate and Display the Start.io (StartApp) Ads in your Mobile Application

Introduction

In-app advertising is one of the most effective monetization strategies for mobile app developers, as it pays them to display advertisements within their apps. It's not a new approach to make money by displaying advertisements. Newspapers were once one of the most effective advertising strategies. As a result, in-app advertising is an important marketing tool for businesses and agencies. In this post we are going see how to implement Start.io (formerly known as StartApp) Ads in Android application.

What is Start.io ?

StartApp is a data-driven mobile technology business that claims to increase eCPMs, fill rates, engaged users, and revenue for publishers. This is accomplished through the company's usage of smart data knowledge to channel ads via programmatic and direct deals. Start.io provides different types of ad format to integrate in Android application like : Splash Ads, Return Ads, Interstitial Ads, Exit Ads, Banner Ads, MRec Ads, Cover Ads, Rewarded Video Ads, Native Ads

Integration of Start.io SDK

To integrate the SDK into your project follow the below steps :

  1. Add dependencies in your project-level build.gradle file
     repositories {
        mavenCentral()
     }
    
  2. Add dependencies in your app-level build.gradle file
      dependencies {
        implementation 'com.startapp:inapp-sdk:4.9.+'
       }
    
  3. Add following permission to AndroidManifest.xml file

If you are targeting to API level 31 (Android 12 or above) then you must have to include this permission in your AndroidMainfest.xml file.

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

Add following permissions to access the Internet and it's state

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

Add following meta-data tag in AndroidMainfest.xml file with your Start.io App ID between and tag.

    <meta-data android:name="com.startapp.sdk.APPLICATION_ID" android:value="startapp_app_id" />

By default Return Ads are enabled, these ads are displayed when a user going back from a Activity in your app. If you want to disable it you can write following cod in your AndroidMainfest.xml file.

 <meta-data android:name="com.startapp.sdk.APPLICATION_ID" android:value="startapp_app_id" />

Implementation

First step of integration is to initialize the Start.io SDK into your activity.

StartAppSDK.init(this@MainActivity,getString(R.string.start_app_ads),false)

Splash Ads

Splash Ads are those ads which displayed immediately after the application is launched. Splash Ads are full page Ads which are shown to users after application launch.

The Splash Ads is enabled by default. If you want to disable it write the following code in your Activity File: StartAppAd.disableSplash()

Interstitial Ads

An interstitial ad is a full-screen online advertisement that spans the host app's whole interface. It's best to put them between the activity and fragment navigation.

Use the showAd() method to show an Interstitial Ad at a specific location inside your app.

Following is the example how you can show an Interstitial Ads between two Activities:

StartAppAd startAppAd = new StartAppAd(this);
startAppAd.loadAd (new AdEventListener() {
    @Override
    public void onReceiveAd(Ad ad) {
     startAppAd.showAd()
    }
    @Override
    public void onFailedToReceiveAd(Ad ad) {
    }
});

Alternatively you can directly write down code in following manner to show Interstitial Ads :

public void onButtonClick (View view){
    Intent secondActivity = new Intent(this, SecondActivity.class);
    startActivity(secondActivity);
    StartAppAd.showAd();
}

Banner Ads

A banner ad is a rectangular advertisement that appears on a mobile device's screen, usually at the top or bottom of the screen. Following is the example of the same.

<com.startapp.sdk.ads.banner.Banner android:id="@+id/startAppBanner" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" />

When you are testing with your app of Ads integration, you should enable the Test Mode by adding following code in your activity file : StartAppSDK.setTestAdsEnabled(BuildConfig.DEBUG)

Best Practices

  1. Don't put banner adverts in places where people might mistakenly click on them.

  2. When a user is interacting with content, never show an interstitial ad.

  3. Always enable test mode while you're in developing mode.

So that is it for this post. Hope you like this post, if you like this post and get some knowledge from this share with you friends as well. Thank you.