Smaato.java

Home   »   Smaato.java

public class MainActivity extends AppCompatActivity {

 @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
           BannerView mBanner = new BannerView (getApplicationContext());

           RelativeLayout myRelativeLayout = (RelativeLayout) findViewById(R.id.banner);
           myRelativeLayout.addView(mBanner, new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,50));

           mBanner.getAdSettings().setPublisherId(yourPublisherId);
           mBanner.getAdSettings().setAdspaceId(yourAdSpaceId);

           mBanner.asyncLoadNewBanner();
        
           
    }
}

Leave a Reply

Your email address will not be published.