im not a coder but if your using java if this code works it will auto set resolution based on screen size
// Java code to display the screen size
import java.awt.*;
class GFG {
public static void main(String[] args)
{
// getScreenSize() returns the size
// of the screen in pixels
Dimension size
= Toolkit.getDefaultToolkit().getScreenSize();
// width will store the width of the screen
int width = (int)size.getWidth();
// height will store the height of the screen
int height = (int)size.getHeight();
System.out.println("Current Screen resolution : "
+ "width : " + width
+ " height : " + height);
}
}