Results 1 to 6 of 6
  1. Thread Author  Thread Author    #1  

    Default Resoution discrepency

    This one's driving me nuts.

    I'm writing an app and have been testing it on my nice shiny new N10 - but my app is reporting the screen resolution as 2464 * 1600 ??!!

    It's not the code as far as I can see as it returns the correct resolution on multiple handsets - just not my N10.

    Anyone know where my missing 96 pixels went? I've Google'd this like crazy, but not come up with anything yet

    PS Lovin' the N10 - best purchase I've made over the last year!
  2. #2  

    Default Re: Resoution discrepency

    Just a thought but could it be the pixels on the bottom of the screen for the navigation bar controlls and such.
    Last edited by Craig King; 02-12-2013 at 03:29 PM.
  3. #3  

    Default Re: Resoution discrepency

    The resolution available to your application itself will be the current statusbar and navbar height subtracted from the full current height. On a device running the tablet UI, they are typically combined at the bottom. If you'd like the application to run in a full-screen mode, try one of the following:

    In your manifest:

    Code:
      <application
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
    You can also declare this at the activity level in your manifest, if you only want specific activities to run fullscreen.

    Alternatively, in your activity's onCreate:

    Code:
      requestWindowFeature(Window.FEATURE_NO_TITLE);
      getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    Call these two methods after super.onCreate() and before setContentView().
  4. Thread Author  Thread Author    #4  

    Default Re: Resoution discrepency

    Hey, thanks for the suggestions, unfortunately, I'm already running without status bar - but maybe there's something else I need to do in Jelly bean? I mean a phone with a 800 x 480 res is reporting exactly that once running without status bar, but the nexus, doesn't - it's really odd. The bar does disappear. (I am using the first method, application level declaration in the manifest)
  5. #5  

    Default Re: Resoution discrepency

    Quote Originally Posted by Android_Zippy View Post
    Hey, thanks for the suggestions, unfortunately, I'm already running without status bar - but maybe there's something else I need to do in Jelly bean? I mean a phone with a 800 x 480 res is reporting exactly that once running without status bar, but the nexus, doesn't - it's really odd. The bar does disappear. (I am using the first method, application level declaration in the manifest)
    Unfortunately I won't have access to my Nexus 10 for a few days, so I can't do any specific testing for you. If your goal here is simply to get information pertaining to the display itself (such as physical resolution), I would look at using the .

    Code:
      DisplayMetrics metrics = new DisplayMetrics();
      getWindowManager().getDefaultDisplay().getMetrics(metrics);
    You should be able to use public int heightPixels and public float ydpi do perform basic calculations, but I should caution you that if this application is intended for more than personal use (i.e. it will be distributed, via the Play Store or other channels), carrying out actions based on the display's physical dimensions may lead to fragmentation issues similar to the one you're already trying to solve.

    Additionally, there are methods of determining the height of the statusbar/navbar on the screen, which theoretically could be used in conjunction with the above code for accessing the display size in order to determine the remaining space for your application. But again, I should note that you may run into fragmentation issues when you start relying on such calculations.
    Thanked by:
  6. Thread Author  Thread Author    #6  

    Default Re: Resoution discrepency

    Thanks mate, I'm using a similar method - but I will try the code you posted. I'm passing it from my activity into my SurfaceView class and using it for a full screen canvas. I need to do it this way as I need to know what size the canvas is going to be before it's been created (for created scaled bitmaps etc). It will be published on the Play Store eventually. It just kind of threw me because every other device I've tested it on returns the correct device resolution. Strange!

Similar Threads

  1. Time Discrepancy issues
    By LegalAmerican in forum Samsung Galaxy Note 10.1
    Replies: 2
    Last Post: 08-28-2012, 10:58 PM
  2. Battery Discrepancy
    By maxman1 in forum Droid RAZR MAXX
    Replies: 2
    Last Post: 07-26-2012, 07:06 PM
  3. Storage Discrepancy?
    By brown3h in forum Google Nexus 7 Tablet (2012)
    Replies: 5
    Last Post: 07-25-2012, 04:36 AM
  4. ICS Data Usage Discrepancy from Verizon
    By Miguel611 in forum Verizon Galaxy Nexus
    Replies: 19
    Last Post: 03-19-2012, 07:57 PM
  5. Battery life discrepancies...
    By slopokdave in forum Samsung Galaxy Tab 10-inch
    Replies: 7
    Last Post: 06-16-2011, 11:29 AM

Posting Permissions

B