Change Game View/Orientation

I’d like to make my game fit within certain parameters, meaning I would like it to fit the aspect ratio of an Android phone. Also, how would I make it so that if the player leaves these parameters, they come out of the other side of the phone?