Using last Adfonic Sdk, and the Android guide : http://developer.adfonic.com/index.php/Android_SDK
I have created two slots for my app (at http://adfonic.com/sites-and-apps/ad-integration) a normal Text Link Banner and a Full Ad.
When I test in the simple case following the guide, I get the simple banner on screen but not the full banner.
My code is like follows:
main.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.adfonic.android.AdfonicView
xmlns:adfonic="http://schemas.android.com/apk/lib/com.adfonic.android"
android:id="@+id/adfonicView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
adfonic:adfonic_adslot_id="AD_SLOT_ID"
adfonic:language="en"
adfonic:refresh_ad="true"
adfonic:refresh_time="30" />
</RelativeLayout>
MainActivity.java
public class MainActivity extends Activity {
private final static String TAG = "Testing";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
AdfonicView adView = (AdfonicView) findViewById(R.id.adfonicView);
adView.setAdListener(new AdListener() {
@Override
public void onReceivedAd() {
Log.d(TAG, "AdListener onReceivedAd()");
}
@Override
public void onPresentScreen() {
Log.d(TAG, "AdListener onPresentScreen()");
}
@Override
public void onNoFill() {
Log.d(TAG, "AdListener onNoFill()");
}
@Override
public void onNetworkError() {
Log.d(TAG, "AdListener onNetworkError()");
}
@Override
public void onLeaveApplication() {
Log.d(TAG, "AdListener onLeaveApplication()");
}
@Override
public void onInvalidRequest() {
Log.d(TAG, "AdListener onInvalidRequest()");
}
@Override
public void onInternalError() {
Log.d(TAG, "AdListener onInternalError()");
}
@Override
public void onDismissScreen() {
Log.d(TAG, "AdListener onDismissScreen()");
}
@Override
public void onClick() {
Log.d(TAG, "AdListener onClick()");
}
});
}}
In Log, I get with normal banner the callbacks “onReceivedAd()” and “onPresentScreen()” are fired, but when full screen ad, only “onReceivedAd()” is been called. And the white screen remains.
The responses for banner requests, are shown in Log too, and in both cases are correct.
Any help is appreciated.
There is a need to place a:
As the ad is interstitial and goes full screen, there is a need to force
the display.
Let me know if this works for you.