tags:

views:

29

answers:

1

I am creating an application for android OS. The problem im facing is that running the application on different devices with different resolutions, the layout eitehr become too small, on hi res screens, or too chunky on low res screens. How do i make it so that my layouts adapt to the screen on the device?? Do i use relative layout Or is there a way i can just find out the max screen length and width...?

A: 

Use RelativeLayout -- thats the best option.

In anycase, if you want to find out the max dimensions:

private void setupGlobal() {

        Display display = getWindowManager().getDefaultDisplay();

        int width = display.getWidth();
        int height = display.getHeight();

        Global.screenHeight = height;
        Global.screenWidth = width;

    }
Sameer Segal