簡體   English   中英

在Android上顯示廣告

[英]Show an advertisement on Android

我必須使用leadboltcontroller jar在屏幕底部顯示廣告。我已經實現了代碼,並且還提供了所有權限集。 但是我沒有得到任何廣告。 這是我的代碼:

public class Leadbolt_DemoActivity extends Activity {
    /** Called when the activity is first created. */

    private AdController mucontroller;
    private String MY_LB_SECTION_ID="328886602";
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
      RelativeLayout rlbottom=(RelativeLayout)findViewById(R.id.relbottom);
      final Activity act = this;  
      rlbottom.post(new Runnable() {

          public void run() { 
              mucontroller = new AdController(act, MY_LB_SECTION_ID); 
              mucontroller.setAsynchTask(true);

              mucontroller.loadNotification();
              mucontroller.setAdditionalDockingMargin(50);
              mucontroller.loadAd(); 
          } 
          //});
      });

我已經在另一台機器上給了另一個應用程序的一個addid,但是我仍然沒有得到任何addid。.每個應用程序和每台機器的addid是唯一的嗎?請幫助我。

使用Relativelayout來放置廣告的頁腳

 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
<bla.bla.AdView
        android:id="@+id/ad"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:background="#FF0000"/>
<ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@id/ad"/>

是您正在尋找的職位。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM