I use a framework called MTX that works on top of LibGDX, so my answer may be different. I am not saying to redo your whole game in MTX, that would be silly. However the framework is open-source, so you can figure out how everything is done with a little bit of looking.
You mainly need to look at 2 main things:
You mentioned a target resolution of 800 x 480, therefore the aspect ratio is ~1.666667. I would set these in some global class made just for resolution:
TARGET_WIDTH = 800;
TARGET_HEIGHT = 480;
TARGET_ASPECT_RATIO = TARGET_WIDTH / TARGET_HEIGHT;
Now we need the current information:
CURRENT_ASPECT_RATIO = Gdx.graphics.getWidth() / Gdx.graphics.getHeight();
What we want to do here is to scale everything while maintaining the aspect ratio. So not every screen is going to be 5:3 specifically, but we can fit the game into 5:3 as best we can and simply constrain the gameplay elements within that area. Anything outside of that area can be background so as not to waste the space.
I am assuming that any device is forced into landscape mode.
WORLD_SCALE = 1;
WORLD_WIDTH = SCREEN_WIDTH;
WORLD_HEIGHT = SCREEN_HEIGHT;
if(CURRENT_ASPECT_RATIO < TARGET_ASPECT_RATIO)
//Filler is on top and bottom
WORLD_SCALE = Gdx.graphics.getWidth();
WORLD_HEIGHT = TARGET_HEIGHT * WORLD_SCALE;
else if(CURRENT_ASPECT_RATIO > TARGET_ASPECT_RATIO)
// Filler is on left and right
WORLD_SCALE = Gdx.graphics.getHeight() / TARGET_HEIGHT;
WORLD_WIDTH = TARGET_WIDTH * WORLD_SCALE;
What this does is finds out your working area. It will fit to whatever size screen, either by length or by height. By applying world scale, we also ensure that your objects scale up for larger screens as well.
For example, my phone has a screen that is 1920x1080. It has a higher aspect ratio than 800x540, and therefore we need to put some bars on the side. This would give me a WORLD_SCALE of 2, a WORLD_HEIGHT of 1080, and a WORLD_WIDTH of 1600, trimming 160 pixels off both sides.
Now it's too late at night for me to go into detail about how to use these values specifically, but it's pretty straightforward. You construct a Viewport object using the newfound values to size and center it. Ensure that your worldWidth and worldHeight for the viewport match your TARGET_WIDTH and TARGET_HEIGHT. Then you can construct your Stage using the new Viewport.
This stage should now be correctly fitted to maintain your desired aspect ratio, while scaling everything to fit the screen as much as possible without messing up the aspect ratio of your game.