Search in sources :

Example 6 with AdView

use of com.google.ads.AdView 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

AdView (com.google.ads.AdView)6 AdRequest (com.google.ads.AdRequest)5 ActionBar (android.app.ActionBar)4 FrameLayout (android.widget.FrameLayout)4 SQLiteDiskIOException (android.database.sqlite.SQLiteDiskIOException)1 IBannerAd (com.abewy.android.ads.IBannerAd)1 Ad (com.google.ads.Ad)1 AdListener (com.google.ads.AdListener)1 ErrorCode (com.google.ads.AdRequest.ErrorCode)1 Date (java.util.Date)1