Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
InMobi SDK for Android
======================

Modified: 16 February, 2023
Modified: 30 August, 2024

SDK Version: 10.5.4
SDK Version: 10.7.7

Thanks for monetizing with InMobi!
If you haven't already, [sign up](https://www.inmobi.com/user/index?locale=en_us#signup) for an account to start monetizing your app!
Expand All @@ -20,7 +20,7 @@ repositories {
mavenCentral()
}
dependencies {
implementation 'com.inmobi.monetization:inmobi-ads-kotlin:10.5.3'
implementation 'com.inmobi.monetization:inmobi-ads-kotlin:10.7.7'
}
```

Expand All @@ -31,16 +31,11 @@ To download the latest SDK as a AAR, please visit [http://inmobi.com/sdk](https:
**To continue integrating with the InMobi SDK, please see the [Integration Guidelines](https://support.inmobi.com/monetize/android-guidelines/) for Android.**

## New in this version
• Gradle 7.0 support
• Bug fixes
• Android 14 support

## Requirements
- Android 4.0.1 (API level 15) and higher
- androidx.browser
- androidx.appcompat
- androidx.recyclerview
- Picasso Library (picasso-2.8.jar)
- **Recommended** Google Play Services 18.0.1
- Android 4.1 (API level 16) and higher
- androidx.appcompat (Not a dependency of SDK. Used only in Sample App)

## License
To view the license for the InMobi SDK, see [here](https://github.com/InMobi/sdk-sample-code-android/blob/master/sdk/licenses/License.txt). To view the terms of service, visit [https://inmobi.com/terms-of-service](http://inmobi.com/terms-of-service/).
Expand Down
7 changes: 3 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,22 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.android.tools.build:gradle:8.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}


ext {
androidMinSdkVersion = 15
androidMinSdkVersion = 16
androidTargetSdkVersion = 31
androidCompileSdkVersion = 31

appVersionCode = 1
appVersionName = "1.0.0"

inmobiSdkVersion = "10.5.4"
fresco = "0.12.0"
inmobiSdkVersion = "10.7.7"
picasso = "2.8"
browser = "1.3.0"
recyclerview = "1.1.0"
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
30 changes: 0 additions & 30 deletions samples/Fresco-License.txt

This file was deleted.

31 changes: 9 additions & 22 deletions samples/bannerSample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'com.android.application'

android {
namespace 'com.inmobi.banner.sample'
compileSdkVersion androidCompileSdkVersion

defaultConfig {
applicationId 'com.inmobi.banner.sample'
minSdkVersion androidMinSdkVersion
Expand All @@ -13,8 +13,9 @@ android {
}
buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationIdSuffix ".release"
}

debug {
Expand All @@ -25,30 +26,16 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
lintOptions {
abortOnError false
}
dexOptions {
javaMaxHeapSize "4g"
}
lint {
abortOnError false
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.aar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'


implementation "com.inmobi.monetization:inmobi-ads-kotlin:$inmobiSdkVersion"
implementation "com.google.android.gms:play-services-ads-identifier:$playservicesadsidentifier"
implementation "com.google.android.gms:play-services-location:$playserviceslocation"
implementation "com.facebook.fresco:fresco:$fresco"
implementation "com.squareup.picasso:picasso:$picasso"
implementation "androidx.browser:browser:$browser"
implementation "com.google.android.gms:play-services-appset:$playservicesappset"
implementation "com.google.android.gms:play-services-tasks:$playservicestask"

// implementation fileTree(dir: 'libs', include: ['*.aar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation ('com.inmobi.monetization:inmobi-ads-kotlin:10.7.7')
}
26 changes: 2 additions & 24 deletions samples/bannerSample/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,5 @@
# public *;
#}

-keepattributes SourceFile,LineNumberTable,InnerClasses
-keep class com.inmobi.** { *; }
-dontwarn com.inmobi.**
-keep class com.google.android.gms.common.api.GoogleApiClient { public *; }
-keep class com.google.android.gms.common.api.GoogleApiClient$* {public *;}
-keep class com.google.android.gms.location.LocationServices {public *;}
-keep class com.google.android.gms.location.FusedLocationProviderApi {public *;}
-keep class com.google.android.gms.location.ActivityRecognition {public *;}
-keep class com.google.android.gms.location.ActivityRecognitionApi {public *;}
-keep class com.google.android.gms.location.ActivityRecognitionResult {public *;}
-keep class com.google.android.gms.location.DetectedActivity {public *;}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient{
public *;
}
-keep class com.google.android.gms.ads.identifier.AdvertisingIdClient$Info{
public *;
}
-dontwarn com.google.android.gms.**
# skip the Picasso library classes
-keep class com.squareup.picasso.** {*;}
-dontwarn com.squareup.picasso.**
# skip Moat classes
-keep class com.moat.** {*;}
-dontwarn com.moat.**
-dontwarn org.conscrypt.Conscrypt
-dontwarn org.conscrypt.OpenSSLProvider
11 changes: 6 additions & 5 deletions samples/bannerSample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.inmobi.banner.sample">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Expand All @@ -12,9 +11,11 @@
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-sdk tools:overrideLibrary="androidx.browser"/>
<application android:allowBackup="true" android:icon="@drawable/icon"
android:label="@string/app_name" android:theme="@style/AppTheme"
android:name="androidx.multidex.MultiDexApplication"
<application
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config">

<activity
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.inmobi.banner;

public interface PlacementId {
long YOUR_PLACEMENT_ID = 1473189489298L;
long YOUR_PLACEMENT_ID = 1651462467602L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import android.widget.ListView;
import android.widget.RelativeLayout;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.inmobi.ads.AdMetaInfo;
import com.inmobi.ads.InMobiAdRequestStatus;
import com.inmobi.ads.InMobiBanner;
Expand Down Expand Up @@ -62,7 +61,6 @@ public void onArticleSelected(int position) {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fresco.initialize(this);
setContentView(R.layout.activity_banner_ads);

setupListView();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.inmobi.banner.sample;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import android.util.Log;
import android.view.View;
Expand All @@ -16,7 +16,7 @@
import org.json.JSONException;
import org.json.JSONObject;

public class BannerBase extends AppCompatActivity {
public class BannerBase extends Activity {

private static final String TAG = BannerBase.class.getName();
private Button normalIntegration;
Expand All @@ -33,7 +33,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
e.printStackTrace();
}

InMobiSdk.init(this, "1234567890qwerty0987654321qwerty12345", consent, new SdkInitializationListener() {
InMobiSdk.init(this, "1234567890qwerty0987654321qwerty1234", consent, new SdkInitializationListener() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be replaced with test placement's account Id?

@Override
public void onInitializationComplete(@Nullable Error error) {
if (error == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.facebook.drawee.view.SimpleDraweeView;

import java.util.List;

Expand All @@ -33,9 +33,9 @@ public View getView(int position, View convertView, @NonNull ViewGroup parent) {
if (null == rowView || null == convertView.getTag()) {
rowView = mInflater.inflate(R.layout.news_headline_view, parent, false);
viewHolder = new ViewHolder();
viewHolder.headline = (TextView) rowView.findViewById(R.id.caption);
viewHolder.content = (TextView) rowView.findViewById(R.id.content);
viewHolder.icon = (SimpleDraweeView) rowView.findViewById(R.id.photo);
viewHolder.headline = rowView.findViewById(R.id.caption);
viewHolder.content = rowView.findViewById(R.id.content);
viewHolder.icon = rowView.findViewById(R.id.photo);
rowView.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) rowView.getTag();
Expand All @@ -52,6 +52,6 @@ public View getView(int position, View convertView, @NonNull ViewGroup parent) {
private static class ViewHolder {
TextView headline;
TextView content;
SimpleDraweeView icon;
ImageView icon;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fresco="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
Expand All @@ -26,11 +25,11 @@
android:orientation="horizontal"
android:layout_marginBottom="6dp">

<com.facebook.drawee.view.SimpleDraweeView
<ImageView
android:id="@+id/photo"
android:layout_width="64dp"
android:layout_height="64dp"
fresco:placeholderImage="@mipmap/ic_launcher"
android:src="@mipmap/ic_launcher"
android:layout_marginLeft="8dp"
android:layout_marginStart="8dp"
android:layout_alignParentLeft="false"
Expand Down
4 changes: 4 additions & 0 deletions samples/bannerSample/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
<color name="link">#0a80d1</color>
<color name="timestamp">#808080</color>
<color name="subtitle">#d3d3d3</color>

<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
2 changes: 1 addition & 1 deletion samples/bannerSample/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- your app branding color for the app bar -->
<item name="colorPrimary">#3F51B5</item>
<!-- darker variant for the status bar and contextual app bars -->
Expand Down
22 changes: 7 additions & 15 deletions samples/customABSample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'com.android.application'

android {
namespace 'com.inmobi.customabsample'
compileSdkVersion androidCompileSdkVersion
buildToolsVersion "29.0.2"

defaultConfig {
applicationId "com.inmobi.customabsample"
Expand All @@ -13,11 +13,15 @@ android {

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationIdSuffix ".release"
}

debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
Expand All @@ -32,18 +36,6 @@ dependencies {


implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

implementation "com.inmobi.monetization:inmobi-ads-kotlin:$inmobiSdkVersion"
implementation "com.google.android.gms:play-services-ads-identifier:$playservicesadsidentifier"
implementation "com.google.android.gms:play-services-location:$playserviceslocation"
implementation "androidx.recyclerview:recyclerview:$recyclerview"
implementation "com.squareup.picasso:picasso:$picasso"
implementation "androidx.browser:browser:$browser"
implementation "com.google.android.gms:play-services-appset:$playservicesappset"
implementation "com.google.android.gms:play-services-tasks:$playservicestask"

}
Loading