简体   繁体   中英

Show an advertisement on Android

I have to show an advertisment on the bottom of the screen using leadboltcontroller jar..I have implemented the code and I have given all the sets of permissions as well. But I am not getting any advertisment. Here is my code:

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(); 
          } 
          //});
      });

I have given one addid of another app in another machine but still i am not getting any addid..Is the addid unique for each app & for each machine???Please help me.

use Relativelayout for footer positioning of ads

 <?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"/>

here is the post which you are looking for..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM