use of com.google.ads.AdView in project Klyph by jonathangerbaud.
the class AdmobBanner method createAdView.
@Override
public View createAdView(Activity activity, ViewGroup adContainer, final IBannerCallback callback) {
// Prevent some crashes in some particular cases
try {
WebViewDatabase.getInstance(activity).clearFormData();
} catch (SQLiteDiskIOException e) {
}
final AdView adView = new AdView(activity, AdSize.BANNER, adMobId);
/*float density = KlyphDevice.getDeviceDensity();
int height = Math.round(AdSize.IAB_MRECT.getHeight() * density);
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, height);
adView.setLayoutParams(params);*/
adView.setAdListener(new AdListener() {
@Override
public void onReceiveAd(Ad arg0) {
callback.onReceiveAd(adView);
}
@Override
public void onPresentScreen(Ad arg0) {
}
@Override
public void onLeaveApplication(Ad arg0) {
}
@Override
public void onFailedToReceiveAd(Ad arg0, ErrorCode errorCode) {
callback.onFailedToReceiveAd(adView, errorCode.name());
}
@Override
public void onDismissScreen(Ad arg0) {
}
});
return adView;
}
use of com.google.ads.AdView in project TextureViewDemo by dalinaum.
the class CameraSurfaceTextureListener method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content);
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
final AdView adView = new AdView(this, AdSize.SMART_BANNER, "a1513f5a0d88abc");
final FrameLayout adContainer = (FrameLayout) findViewById(R.id.adContainer);
adContainer.addView(adView);
AdRequest adRequest = new AdRequest();
// adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
adView.loadAd(adRequest);
mCameraSurfaceTextureListener = new CameraSurfaceTextureListener(this);
mTextureView = (TextureView) findViewById(R.id.texture_view);
mTextureView.setSurfaceTextureListener(mCameraSurfaceTextureListener);
}
use of com.google.ads.AdView in project Klyph by jonathangerbaud.
the class AdmobBanner method loadAd.
@Override
public void loadAd(View adView) {
AdRequest ar = new AdRequest();
if (BannerAdManager.getTargetingBirthday() != BannerAdManager.NONE) {
Date date = new Date();
date.setTime(BannerAdManager.getTargetingBirthday());
ar.setBirthday(date);
}
((AdView) adView).loadAd(new AdRequest());
}
use of com.google.ads.AdView in project TextureViewDemo by dalinaum.
the class Canvas2Activity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content);
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
final AdView adView = new AdView(this, AdSize.SMART_BANNER, "a1513f5a0d88abc");
final FrameLayout adContainer = (FrameLayout) findViewById(R.id.adContainer);
adContainer.addView(adView);
AdRequest adRequest = new AdRequest();
// adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
adView.loadAd(adRequest);
mTextureView = (TextureView) findViewById(R.id.texture_view);
mTextureView.setSurfaceTextureListener(new CanvasListener());
mTextureView.setOpaque(false);
}
use of com.google.ads.AdView in project TextureViewDemo by dalinaum.
the class CanvasActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.content);
ActionBar actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
final AdView adView = new AdView(this, AdSize.SMART_BANNER, "a1513f5a0d88abc");
final FrameLayout adContainer = (FrameLayout) findViewById(R.id.adContainer);
adContainer.addView(adView);
AdRequest adRequest = new AdRequest();
// adRequest.addTestDevice(AdRequest.TEST_EMULATOR);
adView.loadAd(adRequest);
mTextureView = (TextureView) findViewById(R.id.texture_view);
mTextureView.setSurfaceTextureListener(new CanvasListener());
mTextureView.setOpaque(false);
}
Aggregations