Adx3InsertAdView view = new Adx3InsertAdView(this,"UnitId");
设置广告窗体方向
view.setOpt(0);
0-垂直 1-横向,广告位方向默认为垂直,用户可根据具体业务进行配置,用户可跳过当前操作
广告事件监听设置
view.setListener(new AdListener() {
@Override
public void show() {
//Code to be executed when the ad has been showed int Screen
}
@Override
public void loadFaild() {
//Code to be executed when the ad load faild
}
@Override
public void loadSucces() {
//Code to be executed when the ad load success
}
@Override
public void adClose() {
//Code to be executed when the ad close by user
}
@Override
public void adClick() {
//Code to be executed when user click the ad
}
@Override
public void adComplate() {
//Code to be executed when the ad is finish
}
@Override
public void adSkip() {
//Code to be executed when user skip the ad not wait for finish it
}
@Override
public void clickUrl(String url) {
//Code to be executed when user click the ad and tell the url to uesr
}
});
public class MainActivity extends AppCompatActivity {
Adx3InsertAdView view;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//TODO use Create to Add AdView
view = new Adx3InsertAdView(getContext(),"UnitId");
//TODO load the AD
view.loadAd();
}
}