Skip to content

Commit

Permalink
SDK v8.0
Browse files Browse the repository at this point in the history
* commit '1538ed35eca7c59ac84b85a4c1b7299f888f3f72':
  Updated Release Notes
  MS-5054 Visibility Detector
  MS-5011 MS-5040 Viewable Impression
  Android Video position preroll
  onPause is not getting tracked when application is in background
  SDK v8.0
  OMSDKv1.3.31
  MS-5042 Remove discontinued Adapters
  MS-4973 Remove deprecated APIs
  • Loading branch information
avohraa committed Jul 28, 2022
2 parents bb9d8d2 + 1538ed3 commit 10897bb
Show file tree
Hide file tree
Showing 214 changed files with 1,485 additions and 8,176 deletions.
12 changes: 12 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 8.0

### Announcements:

We have completed the removal of the APIs referenced in the 7.21 release. Please note there are breaking changes to some of our APIs, particularly for our init methods which is required for ad calls to be successful- XandrAd.init(). See our [8.0 integration guide](https://docs.xandr.com/bundle/mobile-sdk/page/migrating-android-sdk-v7-to-8-0.html), as well as our [SDK initialization guide](https://docs.xandr.com/bundle/mobile-sdk/page/android---sdk-initialization--v8-0-.html) for further details.

### Improvement/Bug Fixes
+ MS-5011 Updated impression counting methodology. Please see our new [impression counting methodology guide](https://docs.xandr.com/bundle/mobile-sdk/page/updated-impression-counting-mechanism---mobile-sdk-v8-0-and-above.html).
+ MS-5054 Fixed ANR issue related to visibility detector
+ MS-5007 Removed all discontinued mediation adapters
+ MS-5014 Upgraded to OMSDK v1.3.31

## 7.22

### Announcements:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,6 @@ public void setImage(Bitmap bitmap) {
this.coverImage = bitmap;
}

@Override
public String getCreativeId() {
return creativeId;
}

@Override
public void setCreativeId(String creativeId) {
this.creativeId = creativeId;
}

@Override
public String getIconUrl() {
return null;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.example.simplebanner

import android.app.Application
import android.widget.Toast
import com.appnexus.opensdk.XandrAd

class MainApplication: Application() {
override fun onCreate() {
super.onCreate()
XandrAd.init(10094, this, true) {
Toast.makeText(this, "Init Completed", Toast.LENGTH_SHORT).show()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ protected void onCreate(Bundle savedInstanceState) {

bav = new BannerAdView(this);

SDKSettings.useHttps(true);


Log.d("sdkVersion", "sdkVersion: "+ SDKSettings.getSDKVersion());
// This is your AppNexus placement ID.
bav.setPlacementID("17058950");
Expand Down
6 changes: 4 additions & 2 deletions examples/java/SimpleSRM/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:name=".MainApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/ANAppTheme" >
android:theme="@style/ANAppTheme">
<activity
android:name=".MyActivity"
android:label="@string/app_name"
android:configChanges="orientation|screenLayout|screenSize|keyboardHidden">
android:configChanges="orientation|screenLayout|screenSize|keyboardHidden"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.example.simplesrm;

import android.app.Application;
import android.widget.Toast;

import com.appnexus.opensdk.InitListener;
import com.appnexus.opensdk.XandrAd;

public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
XandrAd.init(10094, this, true, new InitListener() {
@Override
public void onInitFinished() {
Toast.makeText(getApplicationContext(), "Init Completed", Toast.LENGTH_SHORT).show();
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ protected void onCreate(Bundle savedInstanceState) {

adRequest = setupNativeAd();

SDKSettings.useHttps(true);


// Set up a listener on this ad view that logs events.
// AdListener adListener =

Expand Down
1 change: 1 addition & 0 deletions examples/java/SimpleVideo/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<uses-permission android:name="android.permission.INTERNET"/>

<application
android:name="MainApplication"
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import android.widget.Toast;
import android.widget.VideoView;

import com.appnexus.opensdk.InitListener;
import com.appnexus.opensdk.ResultCode;
import com.appnexus.opensdk.SDKSettings;
import com.appnexus.opensdk.instreamvideo.Quartile;
Expand Down Expand Up @@ -62,7 +63,7 @@ public class MainActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SDKSettings.init(this, new SDKSettings.InitListener() {
SDKSettings.init(this, new InitListener() {
@Override
public void onInitFinished() {
infoText = (TextView) findViewById(R.id.infotTextView);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.appnexus.example.simplevideo;

import android.app.Application;
import android.widget.Toast;

import com.appnexus.opensdk.InitListener;
import com.appnexus.opensdk.XandrAd;

public class MainApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
XandrAd.init(10094, this, true, new InitListener() {
@Override
public void onInitFinished() {
Toast.makeText(getApplicationContext(), "Init Completed", Toast.LENGTH_SHORT).show();
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
android:theme="@style/AppTheme"
android:name=".MainApplication">

<activity android:name=".MainActivity">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class BannerLazyLoadActivity : AppCompatActivity() {

private fun setupBanner() {
banner = BannerAdView(this)
SDKSettings.useHttps(true)
// This is your AppNexus placement ID.
banner.placementID = "17058950"
// Turning this on so we always get an ad during testing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class MARLoadAndDisplayActivity : Activity() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
WebView.setWebContentsDebuggingEnabled(true)
}
SDKSettings.useHttps(true)

var layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
recyclerListAdView.layoutManager = layoutManager
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.xandr.lazyloaddemo

import android.app.Application
import android.widget.Toast
import com.appnexus.opensdk.XandrAd

class MainApplication: Application() {
override fun onCreate() {
super.onCreate()
XandrAd.init(10094, this, true) {
Toast.makeText(this, "Init Completed", Toast.LENGTH_SHORT).show()
}
}
}
3 changes: 2 additions & 1 deletion examples/kotlin/SimpleDemo/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
android:theme="@style/AppTheme"
android:name=".MainApplication">
<activity android:name=".MainActivity"
android:exported="true">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

SDKSettings.setCountImpressionOn1pxRendering(true)


Settings.getSettings().debug_mode = true
Settings.getSettings().useHttps = true
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package appnexus.example.kotlinsample

import android.app.Application
import android.widget.Toast
import com.appnexus.opensdk.XandrAd

class MainApplication: Application() {
override fun onCreate() {
super.onCreate()
XandrAd.init(10094, this, true) {
Toast.makeText(this, "Init Completed", Toast.LENGTH_SHORT).show()
}
}
}
4 changes: 2 additions & 2 deletions instreamvideo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Project Properties
version = "1.37" // Instream SDK version
version = "1.38" // Instream SDK version

apply plugin: 'com.android.library'

Expand All @@ -10,7 +10,7 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 32
versionCode 35 // An integer value that represents the version of the code, relative to other versions. Increase for each release.
versionCode 36 // An integer value that represents the version of the code, relative to other versions. Increase for each release.
versionName version
consumerProguardFiles 'proguard-project.txt'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,39 +99,6 @@ Context getContext() {
return weakContext.get();
}

/**
* Retrieve the setting that determines whether or not the
* device's native browser is used instead of the in-app
* browser when the user clicks an ad.
*
* @return true if the device's native browser will be used; false otherwise.
* @deprecated Use getClickThroughAction instead
* Refer {@link ANClickThroughAction}
*/
public boolean getOpensNativeBrowser() {
Clog.d(Clog.videoLogTag, Clog.getString(
R.string.set_placement_id, requestParameters.getOpensNativeBrowser()));
return requestParameters.getOpensNativeBrowser();
}

/**
* Set this to true to disable the in-app browser. This will
* cause URLs to open in a native browser such as Chrome so
* that when the user clicks on an ad, your app will be paused
* and the native browser will open. Set this to false to
* enable the in-app browser instead (a lightweight browser
* that runs within your app). The default value is false.
*
* @param opensNativeBrowser
* @deprecated Use setClickThroughAction instead
* Refer {@link ANClickThroughAction}
*/
public void setOpensNativeBrowser(boolean opensNativeBrowser) {
Clog.d(Clog.videoLogTag, Clog.getString(
R.string.set_opens_native_browser, opensNativeBrowser));
requestParameters.setOpensNativeBrowser(opensNativeBrowser);
}

/**
* Sets the placement id of the VideoAd. The placement ID
* identifies the location in your application where ads will
Expand Down Expand Up @@ -248,27 +215,6 @@ public String getAge() {
return requestParameters.getAge();
}

@Deprecated
/**
* Set the current user's externalUID
*
* @param externalUid .
* @deprecated Use ({@link SDKSettings}.setPublisherUserId)
*/
public void setExternalUid(String externalUid) {
requestParameters.setExternalUid(externalUid);
}

@Deprecated
/**
* Retrieve the externalUID that was previously set.
*
* @return externalUID.
*/
public String getExternalUid() {
return requestParameters.getExternalUid();
}

/**
* Add a custom keyword to the request URL for the ad. This
* is used to set custom targeting parameters within the
Expand Down Expand Up @@ -785,20 +731,6 @@ public int getVideoAdDuration() {
return 0;
}

@Deprecated
/**
* Retrieve the Creative Id of the creative .
*
* @return the creativeId
* @deprecated use ({@link ANAdResponseInfo}.getCreativeId)
*/
public String getCreativeId() {
if (getAdResponseInfo() != null) {
return getAdResponseInfo().getCreativeId();
}
return "";
}

/**
* Set AppNexus CreativeId that you want to display on this AdUnit for debugging/testing purpose.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


import com.appnexus.opensdk.ANAdResponseInfo;
import com.appnexus.opensdk.XandrAd;
import com.appnexus.opensdk.instreamvideo.shadows.ShadowSettings;
import com.appnexus.opensdk.instreamvideo.util.Lock;
import com.appnexus.opensdk.ut.UTConstants;
Expand Down Expand Up @@ -32,6 +33,7 @@ public class BaseRoboTest {

@Before
public void setup() {
XandrAd.init(9325, null, false, null);
Robolectric.getBackgroundThreadScheduler().reset();
Robolectric.getForegroundThreadScheduler().reset();
ShadowLog.stream = System.out;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,6 @@ public void testAdPlayStarted() throws Exception {
assertPlayAd(true);*/

}

// Tests the value of ExternalUid
@Test
public void testSetExternalUId(){
setExternalUId();
assertSetExternalUId();

}

/**
Expand All @@ -291,17 +283,6 @@ public void testExtInvCode() {
assertEquals("Xandr", videoAd.getExtInvCode());
}

private void setExternalUId(){
videoAd.setExternalUid("AppNexus");
}

private void assertSetExternalUId(){
assertNotNull(videoAd.getExternalUid());
assertEquals(videoAd.getExternalUid(), "AppNexus");

}


@Override
public void onAdLoaded(VideoAd videoAd) {
adLoaded = true;
Expand Down
Loading

0 comments on commit 10897bb

Please sign in to comment.