1. Download our Official Android App: Forums for Android!

Apps Integrating Ads in a Game

Discussion in 'Android Development' started by synth, Oct 26, 2011.

  1. synth

    synth Lurker
    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    5
    Joined:
    Oct 26, 2011

    Oct 26, 2011
    5
    0
    5
    i have a 2D game which has my custom ViewPanel which handles all the drawings (i don't have android Button elements, all my game controls are painted/handled internally).

    This is my main.xml:
    Code (Text):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    3.     android:orientation="vertical"
    4.     android:layout_width="fill_parent" android:layout_height="fill_parent">
    5. </LinearLayout>
    and this is my activity's onCreate() main code:
    Code (Text):
    1.     viewPanel = new ViewPanel(this);
    2.     setContentView(viewPanel);  
    from this point my ViewPanel handles all the drawings/events.


    Now, i want to integrate Ads (Mobclix), and this is how i do it:
    Code (Text):
    1.     setContentView(R.layout.mobclix_advertising_view);
    2.     Mobclix.onCreate(this);
    3.  
    4.     adview_banner = (MobclixMMABannerXLAdView) findViewById(R.id.advertising_banner_view);
    5.     adview_banner.addMobclixAdViewListener(this);
    6.     adview_banner.setRefreshTime(30000);
    7.     adview_banner.getAd();
    HOWEVER! it seems i can either setContentView on my ViewPanel OR on "advertising_banner_view" not both. So basically either i see my game drawing OR the advertising bar.
    How can i see them both?
     

    Advertisement

Share This Page

Loading...