Why the background bitMap is not fullScreen?
<p>I have 2 question. 
First why the background is not fullscreen but I have this space bottom?
Second why this strange delay of ship in the space when the background is not drawn?</p>

<p><a href="https://i.stack.imgur.com/lr99j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lr99j.png" alt="img1"></a>
<a href="https://i.stack.imgur.com/8P1c6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8P1c6.png" alt="img2"></a></p>

<p>package com.caccagame;</p>

<pre><code>import android.content.Context;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceHolder.Callback;
import android.view.SurfaceView;

public class GamePanel extends SurfaceView implements Callback {

    private MainThread thread;
    private boolean pause_game;
    private Background background;
    private float shipSpeed;
    private Ship ship;

    private int x;
    private int y;


    public GamePanel(Context context, Game game, int screenWidth, int screenHeight ) {
        super(context);
        getHolder().addCallback(this);
        thread=new MainThread(getHolder(), this);
        background=new Background(BitmapFactory.decodeResource(getResources(), R.drawable.game_fon), screenWidth, screenHeight, this);
        setFocusable(true);
        ship=new Ship(BitmapFactory.decodeResource(getResources(), R.drawable.player), screenWidth, screenHeight);
        x=100; //posizione iniziale della nave X
        y=screenHeight/2;
        shipSpeed=screenWidth/2.f;      
    }

    /*public boolean onTouchEvent(MotionEvent event){
        if(event.getAction()==MotionEvent.ACTION_DOWN)
            ship.setUp(true);
        if(event.getAction()==MotionEvent.ACTION_UP){
            ship.setUp(false);
        }       
        return true;
    }*/


    public boolean onTouchEvent(MotionEvent event){

        if(event.getAction()==MotionEvent.ACTION_UP){
            return true;
        }       
        if(event.getAction()==MotionEvent.ACTION_MOVE){
            x=(int)event.getX();
            y=(int)event.getY();

        }   
        if(event.getAction()==MotionEvent.ACTION_DOWN){
            return true;
        }

        return true;
    }

    public void draw(Canvas canvas){
        if(!pause_game)
            if(canvas!=null){               
                background.draw(canvas);
                ship.draw(canvas);
            }
    }

    public void update(float dt){
        background.update(dt);
        ship.update(dt, x, y);
    }

    @Override
    public void surfaceChanged(SurfaceHolder arg0, int arg1, int arg2, int arg3) {
        // TODO Auto-generated method stub

    }

    @Override
    public void surfaceCreated(SurfaceHolder arg0) {
        thread.setRunning(true);
        thread.start();
    }

    @Override
    public void surfaceDestroyed(SurfaceHolder arg0) {
        boolean retray=true;
        while(retray){
            try{
                thread.join();
                retray=false;
            }catch(InterruptedException e){
                System.out.println("errore thread");
            }
        }
    }

    public boolean getPauseGame(){
        return this.pause_game;
    }

    public void setPauseGame(boolean isGamePause){
        this.pause_game=isGamePause;
    }

    public float getShipSpeed() {       
        return shipSpeed;
    }

    public void setThread(boolean isRunning){
        thread.setRunning(isRunning);
    }

}
</code></pre>

<p>package com.caccagame;</p>

<pre><code>import java.util.ArrayList;

import android.graphics.Bitmap;
import android.graphics.Canvas;

public class Ship {

    private Bitmap bitmap;
    private int x;
    private int y;
    private int speed;
    private int screenWidth;
    private int screenHight;
    private ArrayList&lt;Bitmap&gt; boom;
    private boolean death;
    //private boolean up;
    //private float verticalSpeed;

    private float animationTime;
    private float animationTotalTime;
    private float numFrame; //e' uguale alla lunghezza dell'array

    public Ship(Bitmap decodeResource, int screenWidth, int screenHight) {
        this.bitmap=decodeResource;
        this.x=0;
        this.y=0;
        this.screenWidth=screenWidth;
        this.screenHight=screenHight;
        speed=1;
        death=false;
        boom=null;
        animationTime=0;
        animationTotalTime=1;
        //verticalSpeed=0;
    }

    public void setBoomAnimation(ArrayList&lt;Bitmap&gt; boomBitmap){
        this.boom=new ArrayList&lt;Bitmap&gt; (boomBitmap);
        numFrame=boom.size()+1;

    }   

    public void draw(Canvas canvas){
        if(!death){
            canvas.drawBitmap(bitmap, x-bitmap.getWidth()/2, y-bitmap.getHeight()/2, null);
        }
        else{
            int index=(int)(animationTime/animationTotalTime*numFrame);
            if(index&lt;numFrame){
                canvas.drawBitmap(boom.get(index), x-bitmap.getWidth()/2, y-bitmap.getHeight()/2, null);
            }
        }
    }

    public void update(float dt, int x, int y){
        if(death){
            animationTime+=dt;
        }
        else{
            this.x=x;
            this.y=y;

        }
    }


    /*public void draw(Canvas canvas){
        if(!death){
            canvas.drawBitmap(bitmap, x-bitmap.getWidth()/2, y-bitmap.getHeight()/2, null);
        }
        else{
            int index=(int)(animationTime/animationTotalTime*numFrame);
            if(index&lt;numFrame){
                canvas.drawBitmap(boom.get(index), x-bitmap.getWidth()/2, y-bitmap.getHeight()/2, null);
            }
        }
    }*/

    /*public void update(float dt){
        if(death){
            animationTime+=dt;
        }
        else{
            verticalSpeed+=screenHight/2*dt;
            if(up)
                verticalSpeed-=screenHight*dt*2;    
            y+=verticalSpeed*dt;
            if(y-(bitmap.getHeight()/2)&gt;screenWidth)
                y=0-(bitmap.getHeight()/2);

        }
    }*/



    /*public void setUp(boolean b) {
        this.up=b;
    }   */


}
</code></pre>

<p>package com.caccagame;</p>

<pre><code>import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;

public class Background {

    Bitmap backBitmap;
    int x;
    int y;
    int screenWidth;
    int countBackground;
    GamePanel gamePanel;
    Paint paint=new Paint();

    public Background(Bitmap bm, int screen_w, int screen_h, GamePanel gamePanel){
        this.backBitmap=bm;
        this.screenWidth=screen_w;
        this.x=0;
        this.y=0;//(screen_h- backBitmap.getHeight())/2 ;
        this.countBackground=screenWidth/backBitmap.getWidth()+1;
        this.gamePanel=gamePanel;
        paint.setFilterBitmap(true);
    }

    public void draw(Canvas canvas){
        for(int i=0; i&lt;countBackground+1; i++){
            if(canvas!=null)
                canvas.drawBitmap(backBitmap, backBitmap.getWidth()*i+x, y, paint);
        }
        if(Math.abs(x)&gt;backBitmap.getWidth())
            x=x+backBitmap.getWidth(); 
    }

    public void update(float dt){
        x=(int)(x-gamePanel.getShipSpeed()*dt);
    }
}
</code></pre>