How do I determine Android Screen Width/Height?

Hello,
I've done a Google Search for finding the screen size in Android, but only found Java code(which I can't use).
The closest thing I found was:
maxwidth=stage.stageWidth;
maxheight=stage.stageHeight;
And they seemed reasonable, however when I drew an object at maxwidth on my HTC Sensation, it only drew in about the middle of the screen.
So I am very confused.  A person simply cannot write Aps for Android unless they can get screen size because everyone's phone is different.
Any help?

I don't need an answer very fast because I can still develop for my own resolution and tweak later once I get this code.
I do have a game you can play for free here:
http://www.goodnewsjim.com/DiamondDrop/HowToPlay.html
Which I ported to Android.
But no one can play it because everyone has different resolution phones
Someday, I'll have an ap on the Market

Similar Messages

  • How can you create a screen width slide show?

    I have created screen width images that resize depending on the screen resolution using the fill option.
    However, when I use any of the slide show widgets and size them to the edge of the site, it doesn't fill the screen width on the live mode. It always leaves a margin.
    What can I do?

    Widgets do not support full width or responsive. I hope they do support it in the near future though.

  • Need to find "real" width/height of loaded SWF

    So, I'm creating a player that will eventually be able to
    play back both FLV and SWF files. While testing the SWF
    functionality, I noticed some funkiness with resizing the SWF once
    loaded into a movieClip.
    Yes, I already do know that loading (via MovieClipLoader)
    needs to have finished before I can get the actual width and height
    of the SWF in question... that's not the issue.
    The issue is that I will not know ahead of time what the SWF
    dimensions are. Which should be ok, as long as I can get accurate
    dimensions after the SWF has loaded. However, I do not have control
    over the source SWFs - they could come from anywhere (many content
    providers), and in the event that the remote SWF uses masking, the
    width and height may not quite be accurate.
    Here is an example - as a test, I have my player load
    http://www.magicarchive.com/jawsbunnies.swf
    into a movieclip via MovieClipLoader. Peachy-keen, it works. I then
    want to resize the movieclip to be 400px wide by 300 tall. Doing
    this by setting _width and _height (or _xscale and _yscale) makes
    the visible area of the movie too small because of masking or
    whatever (before scaling, tracing _width and _height on the source
    movie shows width = 856.4 and height = 637.45... after resizing the
    swf in a movieclip to 400wide x 300 tall, the actual visible movie
    seems to be more like 334wide x 254tall). I can't even center the
    smaller-than-I-want-it-to-be clip because I can't determine its
    real width.
    So, how might I find the "real" width/height of the visible
    area? Is it a case of requiring some accompanying metadata from my
    SWF providers? I've also tried using hitTest, and while the hitTest
    area is slightly smaller than the width and height, it is still
    slightly larger than the real visible dimensions, so testing the
    hittable area to determine the visible area won't work, either. I'd
    like to try determining SWF dimensions without having to bother
    providers, though.
    When I put this same SWF into an HTML page with Dreamweaver,
    it automatically sizes to 720x540, which seems to be the "real"
    visible dimensions. How do I get to those dimensions once the SWF
    is loaded into a movieClip, though?
    Thanks for any help.

    Doh. I read in another post that "there is no way to
    determine what size at which an SWF was exported".
    So, there is no way I can determine the real visible
    dimensions of an SWF I have no control over?
    It seems like there SHOULD be a way to do this - since for
    example, if I embed an SWF into an HTML page (via Dreamweaver),
    Dreamweaver automatically determines the correct "Stage" size. This
    is what I need to do, only within AS...

  • How to get full screen width and height  when using CustomItem not canvas ?

    hi..
    I have to append one Textfield and a CustomItem ( as canvas) for painting on a single form.
    I have to draw a rectangle in CustomItem in full Screen width of mobile .
    So I have to know the screen width of mobile for drawing a rectangle.
    Please Suggest me. how can I do that ?
    Thanks

    Did you check javax.microedition.lcdui.Form.getWidth() and javax.microedition.lcdui.Form.getHeight() methods?
    Atul

  • Background, screen-width and screen-height

    can you help me a bit guys? how shall I create a movie where
    the background will be always 100% of screen-width and 100% of
    screen-height but the rest of the movie will be not affected by
    screen resolution - it means will be of fixed size.
    example: have a photo in front (200x300px) which needs to be
    always of that size and the background will resize according to the
    screen resoluiton ...
    it is even possible? thanks for any help ...

    Hello,
    Could you please try unchecking the sticky footer option from Site properties and then check if you face the same issue or not?
    Regards,
    Sachin

  • SFML? What do you get when you divide screen width or height by sprite width or height?

    I am new to game programming and I am constantly seeing people divide the screens width or height by an in game objects width or height. My question is what does the number that they receive stand for. What exactly do you get when you divide the screens
    dimensions by a in game objects dimensions?

    You can calculate how small your object have to be drawn from the original , if you zoom your camera (screen) out and vice versa in 2D.  In 3D you will require  to use matrix transformation instead.
    See this example:
    1) Your original designed dimensions 
           Screen_width_old  ,  Screen Height_old  ,    Sprite_width_old   ,  Sprite_height_old 
    2) After window resizing:
          Screen_width_new  ,  Screen_height_new      (new values)
        Then,  Sprite_height_new=Sprite_height_old * (Screen_height_new / Screen_height_old) ;
       also
        Then,  Sprite_width_new=Sprite_width_old * (Screen_width_new / Screen_width_old) ;

  • Shell script to determine file width, height, resolution cs5 js

    I’ve been using a Script by Michael L Hale (that utilizes »xmp.getProperty« and Bridge’s »core.quickMetadata«) to determine files’s dimension and resolution without having to open or place them.
    Unfortunately it fails with some files (non-Photoshop generated bitmaps, it seems).
    (Pdfs I treat differently altogether to avoid the trouble of determining pdf-page counts and potential problems with pdfs containing differently sized pages.)
    Do any of you know if and how one can access files’ width, height, resolution with »app.system« in CS5?
    I may have come across it before, but can’t locate such a thread currently.
    Thanks for any input.

    These are 2 options that you could use if you wanted to dump all the info to text file then parse in JS. You could see if either of these contain the data that you are after?
    #target bridge
    var foo = File('~/Desktop/SomeFile.tif');
    getAllXMLSIPS(foo);
    //getMetaDataMDLS(foo)
    function getAllXMLSIPS(f) {
         if (f instanceof File && f.exists) {
              var shellString = "sips --getProperty allxml ";
              shellString += f.fsName;
              shellString += ' > ~/Documents/StdOut.txt';
              app.system(shellString);
    function getMetaDataMDLS(f) {
         if (f instanceof File && f.exists) {
              var shellString = "/usr/bin/mdls ";
              shellString += f.fsName;
              shellString += ' > ~/Documents/StdOut.txt';
              app.system(shellString);

  • In InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to

    This may be a basic question... but in InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to determine what word count we can fit in, and c) how to do it in a table? Thanks!

    Set your ruler increments to pixels Preferences>Units & Increments. You can fill the text box with placeholder text Type>Fill with Placeholder text and get a word count from the Info panel with Show Options turned on from the flyout.
    From the Transform panel you can set a text box's width and height

  • How to determine the screen structure of the detail area of a screen...

    Hi all,
              How to determine the screen structure of the detail area of a screen?

    Hi,
    go to se38,
    loop at SCREEN.
    endloop.
    put the cursor on SCREEN and press F1, then u can seee it.
    Regards,
    Pavan
    Edited by: vishnu Pavan on Mar 23, 2009 11:03 AM

  • How to set width/height of iPad app in ipa file

    Hello,
    I am developing an app for iPad in Flash Builder 4 and Packager for Iphone.
    I set the width and height node values in the descriptor XML and compile the application. When I run the same in iPad, I am not able to see any effect on the app's width and height.
    Also, in default load, app opens in dimensions as per the iphone view and not specifically for iPad.
    Any help?
    Tanu

    hi,
    How does your application descriptor file look like? I also had the same problem, when I realised that I had a few things missing in my app desc. file. My file looks like this
    <?xml version="1.0" encoding="utf-8" standalone="no"?>
    <application xmlns="http://ns.adobe.com/air/application/2.0">
        <id>IPadApp</id>
        <filename>IPadApp</filename>
        <name>IPadApp</name>
        <version>v1</version>
         <initialWindow>
            <content>IPadApp.swf</content>
            <fullScreen>true</fullScreen>
            <autoOrients>true</autoOrients>
            <title>IPadApp</title>
            <aspectRatio>portrait</aspectRatio>
            <systemChrome>none</systemChrome>
            <transparent>false</transparent>
            <visible>true</visible>
            <!-- Portrait -->       
            <width>768</width>
            <height>1024</height>       
            <!-- Landscape -->
            <!--
            <width>1024</width>
            <height>768</height>
            -->
            <!--<x>100</x>
            <y>100</y>-->
            </initialWindow>
        <supportedProfiles>desktop mobileDevice</supportedProfiles>
    <iPhone>
      <InfoAdditions>
      <![CDATA[
        <key>UIDeviceFamily</key>
        <array>
        <string>2</string>
        </array>
      ]]>
      </InfoAdditions>
      </iPhone>
    </application>
    Check your desc. file.
    -Vrushali

  • How to export layer width, height, and position to a text document?

    I am working on an automated workflow for which I need to know the exact width, height, and position in pixels of certain layers in a PSD.
    I am pretty sure this is possible with applescript but does anyone know of a way to have this info included automatically in the documents metadata?
    thanks,
    ryan

    Hi Gabriele - how did you add the subs to FCP? if you added them using the text tools built in then you need to try to extract those first. Neither FCP or DVDSP are good places to create subtitles, but apps like STL Edit and Belle Nuit are. These will both create subs that can be imported into DVDSP. You can also use a text file to import the subs as long as the text file is set up correctly. The precise format is listed in the manual for DVDSP and a tool like BBEdit is ideal if you want to do the subs this way. Some folk even use Excel to set up the timecodes, etc, but personally I find that too distracting, preferring to work with STL Edit when I need to add subs.
    One thing is almost universally agreed upon in here - create the subs outside of DVDSP and import them in, since if you need to move, alter or otherwise change them it is a lot easier from within a text file than from within DVDSP.

  • My Firefox window used to be about 3/4 of my screen width but after crashung and restarting is now full screen width. How do I get the Firefox window back to 3/4 screen width?

    I don't want my Firefox browser window to be the full screen width. How do I adjust the browser window width?
    Thank you.

    This can be a problem with the file [http://kb.mozillazine.org/localstore.rdf localstore.rdf] in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder].
    Delete localstore.rdf or rename the file to localstore.rdf.sav in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder] to test if the file is corrupted.<br />
    See http://kb.mozillazine.org/Corrupt_localstore.rdf<br />
    (caution: do not delete the localstore.rdf file in the Firefox program installation folder)

  • How can I get the image width and height stored in database?

    Hi!I write s servlet to display images store in database.but how can I get the image width and height?

    Have you tryed using PJA or a similar library?
    I presume you get java.lang.NoClassDefFoundError on the line :
    Toolkit.getDefaultToolkit();?

  • No width/height set for items.This will cause an infinite loop. Aborting....... How do I get out of this?

    How do I get out of this?

    What are you talking about? The width/height of what? Is this some sort of error message? If so from what?

  • How to Increase the Selection screen window length width big....

    How to Increase the Selection screen window length width big....  I cant able to do some enter text... because of the window size it gives error... can anyone help me out this...
    Thanks in advance

    hi,
    Maximum size is fixed for selection-screen.
    Split your text into different lines to fit it.
    Create a text element for your text and write it as comments.
    selection-screen begin of block b3 with frame title text-041.
      selection-screen begin of line.
        parameters : p_all radiobutton group g2 default 'X'.
        selection-screen comment 10(75) text-049.
      selection-screen end of line.
      selection-screen begin of line.
        parameters : p_iloc radiobutton group g2.
        selection-screen comment 10(75) text-050.
      selection-screen end of line.
    selection-screen end of block b3.
    Regards
    Sailaja.

Maybe you are looking for