Popular questions for this item

How can I add a banner ad to the App?

To add an Admob banner ad just open screen.java and replace the onCreate() method with this one here:

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        activity = this;

        //full screen
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

        //create surface
        layout = new RelativeLayout(this);
        surface = new SurfaceView(this);
                layout.addView(surface);
        //TODO:MAKE SURE TO REMOVE INTERSTATIAL ADs BY GOING TO MAINGAME.JAVA LINE 625 AND REMOVING openAd();

        AdView ad = new AdView(this, AdSize.BANNER, "PUT YOUR AD UNIT ID HERE"); //make sure id is of banner ad.
        //layout
        RelativeLayout.LayoutParams params1 = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
        params1.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
        params1.addRule(RelativeLayout.CENTER_HORIZONTAL);
        ad.setLayoutParams(params1);
        layout.addView(ad);
        AdRequest request = new AdRequest();
        ad.loadAd(request);
        //TODO :----------------------------------------------------------------------------------------------------------------------------------------------

        setContentView(layout);
        holder = surface.getHolder();

        //listeners
        surface.setOnTouchListener(this);

        // start game loop
        thread = new Thread(this);
        thread.start();

        onCreate();

    }
For the code to work you need to import the 4 items below, so go ahead and add them in line 4 of screen.java:
import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;
import android.widget.RelativeLayout.LayoutParams;
by
by
by
by
by
by