Skip to content

Commit d994ece

Browse files
committed
SDK v7.0
* commit 'a3bef5f613283aa5590604e8947009ee00d51fbb': Updated Release Notes and SDK version Merge pull request #355 in MOBILE-SDK/app_mobile-sdk-android from MS-4094_OMID_SupportedFalse_Android to develop OMID Certification For Instream Video MultiAdRequest Android
2 parents ad6b971 + a3bef5f commit d994ece

File tree

95 files changed

+7349
-906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+7349
-906
lines changed

RELEASE-NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 7.0
2+
### New Features
3+
+ MS-3885 Added support for Multi Ad Request (MAR) [https://wiki.xandr.com/display/sdk/Single+Request+Mode+for+Android]
4+
15
## 6.2
26
### New Features
37
+ MS-4097 California Consumer Privacy Act (CCPA) Support (https://wiki.xandr.com/display/sdk/SDK+Privacy+for+Android)

examples/java/SimpleSRM/.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## From SO (second answer on page):
2+
## http://stackoverflow.com/questions/16736856/what-should-be-in-my-gitignore-for-an-android-studio-project
3+
## --------------------------------------------------------------------
4+
5+
# built application files
6+
*.apk
7+
*.ap_
8+
9+
# files for the dex VM
10+
*.dex
11+
12+
# Java class files
13+
*.class
14+
15+
# built native files
16+
*.o
17+
*.so
18+
19+
# generated files
20+
bin/
21+
gen/
22+
23+
# Ignore gradle files
24+
.gradle/
25+
build/
26+
27+
# Local configuration file (sdk path, etc)
28+
local.properties
29+
30+
# Proguard folder generated by Eclipse
31+
proguard/
32+
33+
# Eclipse Metadata
34+
.metadata/
35+
36+
# Mac OS X clutter
37+
*.DS_Store
38+
39+
# Windows clutter
40+
Thumbs.db
41+
42+
# Intellij IDEA (see https://intellij-support.jetbrains.com/entries/23393067)
43+
.idea/workspace.xml
44+
.idea/tasks.xml
45+
.idea/datasources.xml
46+
.idea/dataSources.ids
47+
48+
# AAR files
49+
*.aar

examples/java/SimpleSRM/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# SimpleSRM
2+
3+
This is the simplest possible "app" that can fetch and show banner ads
4+
using the [AppNexus SDK](https://github.com/appnexus/mobile-sdk-android).
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 28
5+
buildToolsVersion '29.0.0'
6+
lintOptions {
7+
abortOnError false
8+
}
9+
defaultConfig {
10+
applicationId "com.example.simplesrm"
11+
minSdkVersion 18
12+
targetSdkVersion 28
13+
versionCode 1
14+
versionName "1.0"
15+
multiDexEnabled true
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
buildTypes {
19+
release {
20+
minifyEnabled false
21+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22+
}
23+
}
24+
sourceSets {
25+
main.manifest.srcFile 'src/main/AndroidManifest.xml'
26+
main.java.srcDir 'src/main/java'
27+
main.res.srcDir 'src/main/res'
28+
main.resources.srcDir 'src/main/java'
29+
}
30+
packagingOptions {
31+
exclude 'AndroidManifest.xml'
32+
exclude 'res/drawable/progress.xml'
33+
exclude 'res/layout/activity_in_app_browser.xml'
34+
exclude 'res/raw/anjam.js'
35+
exclude 'res/raw/mraid.js'
36+
exclude 'res/raw/sdkjs.js'
37+
}
38+
productFlavors {
39+
}
40+
}
41+
42+
dependencies {
43+
implementation('com.google.android.gms:play-services-base:16.1.0') { transitive = false }
44+
implementation 'com.android.support:multidex:1.0.3'
45+
api project(':sdk')
46+
api project(':instreamvideo')
47+
// implementation project(':GooglePlay')
48+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
49+
androidTestImplementation 'androidx.test:rules:1.1.1'
50+
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.1'
51+
androidTestImplementation 'androidx.test.espresso:espresso-web:3.1.1'
52+
implementation 'androidx.test.espresso:espresso-idling-resource:3.1.1'
53+
// implementation project(':SmartAdServer')
54+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Applications/Android Studio.app/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
package com.example.simplesrm;
2+
3+
import android.content.Intent;
4+
5+
import androidx.test.espresso.IdlingPolicies;
6+
import androidx.test.espresso.IdlingRegistry;
7+
import androidx.test.rule.ActivityTestRule;
8+
import androidx.test.runner.AndroidJUnit4;
9+
10+
import com.appnexus.opensdk.Ad;
11+
12+
import org.junit.After;
13+
import org.junit.Assert;
14+
import org.junit.Before;
15+
import org.junit.Rule;
16+
import org.junit.Test;
17+
import org.junit.runner.RunWith;
18+
19+
import java.lang.ref.WeakReference;
20+
import java.util.ArrayList;
21+
import java.util.concurrent.TimeUnit;
22+
23+
import static androidx.test.espresso.Espresso.onView;
24+
import static androidx.test.espresso.assertion.ViewAssertions.matches;
25+
import static androidx.test.espresso.matcher.ViewMatchers.isRoot;
26+
import static org.hamcrest.Matchers.anything;
27+
28+
29+
/**
30+
* Instrumented test, which will execute on an Android device.
31+
*
32+
* See [testing documentation](http://d.android.com/tools/testing).
33+
*/
34+
@RunWith(AndroidJUnit4.class)
35+
public class MyActivityTest {
36+
37+
@Rule
38+
public ActivityTestRule mActivityTestRule = new ActivityTestRule(MyActivity.class, false, false);
39+
40+
MyActivity myActivity;
41+
42+
43+
@Before
44+
public void setup() {
45+
IdlingPolicies.setMasterPolicyTimeout(1, TimeUnit.MINUTES);
46+
IdlingPolicies.setIdlingResourceTimeout(1, TimeUnit.MINUTES);
47+
Intent intent = new Intent();
48+
mActivityTestRule.launchActivity(intent);
49+
myActivity = (MyActivity) mActivityTestRule.getActivity();
50+
IdlingRegistry.getInstance().register(myActivity.idlingResource);
51+
}
52+
53+
@After
54+
public void destroy() {
55+
IdlingRegistry.getInstance().unregister(myActivity.idlingResource);
56+
}
57+
58+
@Test
59+
public void testMARWeakReference() {
60+
Assert.assertFalse(myActivity.multiAdRequestCompleted);
61+
myActivity.load();
62+
// Assert.assertTrue(myActivity.multiAdRequestCompleted);
63+
myActivity.adRequest = null;
64+
myActivity.load();
65+
onView(isRoot()).check(matches(anything()));
66+
Assert.assertTrue("MultiAdRequest is still in progress, Idling Resource isn't working properly", myActivity.multiAdRequestCompleted);
67+
}
68+
69+
@Test
70+
public void testConcurrentMARLoad() {
71+
Assert.assertFalse(myActivity.multiAdRequestCompleted);
72+
myActivity.load();
73+
// Assert.assertTrue(myActivity.multiAdRequestCompleted);
74+
myActivity.adRequest = null;
75+
myActivity.load();
76+
myActivity.load2();
77+
onView(isRoot()).check(matches(anything()));
78+
Assert.assertTrue("MultiAdRequest is still in progress, Idling Resource isn't working properly", myActivity.multiAdRequestCompleted);
79+
Assert.assertTrue("MultiAdRequest2 is still in progress, Idling Resource isn't working properly", myActivity.multiAdRequestCompleted2);
80+
}
81+
82+
@Test
83+
public void testMARDeallocatedAdUnit() {
84+
Assert.assertFalse(myActivity.multiAdRequestCompleted);
85+
myActivity.load();
86+
// Assert.assertTrue(myActivity.multiAdRequestCompleted);
87+
myActivity.adRequest = null;
88+
myActivity.load();
89+
onView(isRoot()).check(matches(anything()));
90+
ArrayList<WeakReference<Ad>> adUnitList = myActivity.anMultiAdRequest.getAdUnitList();
91+
for (WeakReference<Ad> adWeakReference : adUnitList) {
92+
Ad ad = adWeakReference.get();
93+
if (ad != null) {
94+
Assert.assertFalse(adWeakReference.get() == myActivity.adRequest);
95+
}
96+
}
97+
Assert.assertTrue("MultiAdRequest is still in progress, Idling Resource isn't working properly", myActivity.multiAdRequestCompleted);
98+
}
99+
100+
@Test
101+
public void testMARDeallocateAdUnitWhileTheLoadIsActive() {
102+
Assert.assertFalse(myActivity.multiAdRequestCompleted);
103+
myActivity.load();
104+
// Assert.assertTrue(myActivity.multiAdRequestCompleted);
105+
myActivity.adRequest = null;
106+
onView(isRoot()).check(matches(anything()));
107+
ArrayList<WeakReference<Ad>> adUnitList = myActivity.anMultiAdRequest.getAdUnitList();
108+
for (WeakReference<Ad> adWeakReference : adUnitList) {
109+
Ad ad = adWeakReference.get();
110+
if (ad != null) {
111+
Assert.assertFalse(adWeakReference.get() == myActivity.adRequest);
112+
}
113+
}
114+
Assert.assertTrue("MultiAdRequest is still in progress, Idling Resource isn't working properly", myActivity.multiAdRequestCompleted);
115+
}
116+
117+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2014 APPNEXUS INC
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
18+
package="com.example.simplesrm" >
19+
20+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
21+
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
22+
<uses-permission android:name="android.permission.INTERNET" />
23+
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
24+
25+
<application
26+
android:allowBackup="true"
27+
android:icon="@drawable/ic_launcher"
28+
android:label="@string/app_name"
29+
android:theme="@style/ANAppTheme" >
30+
<activity
31+
android:name=".MyActivity"
32+
android:label="@string/app_name"
33+
android:configChanges="orientation|screenLayout|screenSize|keyboardHidden">
34+
<intent-filter>
35+
<action android:name="android.intent.action.MAIN" />
36+
37+
<category android:name="android.intent.category.LAUNCHER" />
38+
</intent-filter>
39+
40+
</activity>
41+
<activity android:name="com.appnexus.opensdk.AdActivity"
42+
android:configChanges="orientation|screenLayout|screenSize|keyboardHidden"/>
43+
</application>
44+
</manifest>

0 commit comments

Comments
 (0)