1. Are you ready for the Galaxy S20? Here is everything we know so far!

Apps Multiple Screen Support - Screen Width

Discussion in 'Android Development' started by moap, Feb 17, 2011.

  1. moap

    moap Newbie
    Thread Starter

    Hi all,

    I'm working on a game and got stuck with something. The whole scenario depends on the screen width and i developed the game on a 420 px width phone. I want to know whether or not i can force/change resolution, density or something to make phone screen width fit 420 px.


  2. JamTheMan

    JamTheMan Well-Known Member

    You cant change the resolution of the screen, but you can scale your graphics to fit the screensize. To read the screens size call something like this on the running activity:

    Code (Text):
    2. screenX = getResources().getDisplayMetrics().widthPixels;
    3. screenY = getResources().getDisplayMetrics().heightPixels;

Share This Page