Search in sources :

Example 1 with AdRequest

use of com.google.ads.AdRequest 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);
}
Also used : AdRequest(com.google.ads.AdRequest) FrameLayout(android.widget.FrameLayout) AdView(com.google.ads.AdView) ActionBar(android.app.ActionBar)

Example 2 with AdRequest

use of com.google.ads.AdRequest 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());
}
Also used : AdRequest(com.google.ads.AdRequest) AdView(com.google.ads.AdView) Date(java.util.Date)

Example 3 with AdRequest

use of com.google.ads.AdRequest 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);
}
Also used : AdRequest(com.google.ads.AdRequest) FrameLayout(android.widget.FrameLayout) AdView(com.google.ads.AdView) ActionBar(android.app.ActionBar)

Example 4 with AdRequest

use of com.google.ads.AdRequest 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);
}
Also used : AdRequest(com.google.ads.AdRequest) FrameLayout(android.widget.FrameLayout) AdView(com.google.ads.AdView) ActionBar(android.app.ActionBar)

Example 5 with AdRequest

use of com.google.ads.AdRequest in project TextureViewDemo by dalinaum.

the class GLTriangleActivity 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);
    mVertices = ByteBuffer.allocateDirect(mVerticesData.length * 4).order(ByteOrder.nativeOrder()).asFloatBuffer();
    mVertices.put(mVerticesData).position(0);
    mTextureView = (TextureView) findViewById(R.id.texture_view);
    mTextureView.setSurfaceTextureListener(new GLSurfaceTextureListener());
}
Also used : AdRequest(com.google.ads.AdRequest) FrameLayout(android.widget.FrameLayout) AdView(com.google.ads.AdView) ActionBar(android.app.ActionBar)

Aggregations

AdRequest (com.google.ads.AdRequest)5 AdView (com.google.ads.AdView)5 ActionBar (android.app.ActionBar)4 FrameLayout (android.widget.FrameLayout)4 Date (java.util.Date)1