Getting Mobile Device (Correct) Screen Size

I have some confusion over getting the screen size of a mobile device. I measured the following:
var hsa:AlertObject = new AlertObject();
hsa.alertMessage = "screen w:" +  this.stage.fullScreenWidth + "  h:" + this.stage.fullScreenHeight + "\n" +
                    "capscreen w: " + capmc.width + " h:" + capmc.height + "\n" +                    
                    "capabilites w: " + Capabilities.screenResolutionX + " h: " + Capabilities.screenResolutionY;
hsa.open(this, false);
I ran this on an iPod touch 4 which has a resolution of 960 X 640. The above code gives me:
screen = 480 X 320
capscreen (a movie clip I load that is scaled to the full screen and is displaying properly) = 1548.85 X 677 (I presume the original dimensions my designer gave the SWF).
Capabilities = 480 X 320
Note that 480 X 320 is precisely half of the actual screen dimensions of an iPod Touch 4. Can someone please tell me why. And, given that capscreen is displaying (properly) at the time I take these measurements and display results, why is capscreen reporting larger than the actual dimensions of the device? Also, my app orrientation is landscape only and yet the dimensions I'm getting are that width is < height which means the device is reporting in portrait mode.
If I just need to check for iOS and then double dimensions, that's fine. But, I don't want to do that for this iPod Touch test to find it works differently on other iOS devices.
I know that all of my screens are on the stage, BTW. I know this because I get the AlertObject to show me alerts by pressing one of the buttons of a loaded screen I am measuring - and the button is not enabled until all SWF's are finished loading and being added to stage.

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark" title="NewCappoCamera" actionBarVisible="false" xmlns:mx="library://ns.adobe.com/flex/mx">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
private function loadSWF():void {
pictureButtons.load();
pictureButtons.content.addEventListener(Event.ADDED, loadComplete);
//initCamera();
private var mc:MovieClip;
private var hasBeenInit:Boolean = false;
private function loadComplete(event:Event):void{
event.target.removeEventListener(Event.ADDED, loadComplete);
if(event.target is MovieClip && mc == null) {
mc = MovieClip(event.target);
mc.play();
if(event.target.name == "acceptPicBtn") {
acceptButton = SimpleButton(event.target);
acceptButton.enabled = false;
else if(event.target.name == "retakePicBtn") {
retakeButton = SimpleButton(event.target);
retakeButton.addEventListener(MouseEvent.CLICK, retakeClicked);
retakeButton.enabled = false;
else if(event.target.name == "takePicBtn") {
cameraButton = SimpleButton(event.target);
cameraButton.addEventListener(MouseEvent.CLICK, cameraButtonPressed);
if(cameraButton != null && acceptButton != null
&& retakeButton != null && cameraButton != null && mc != null && !hasBeenInit) {
mc.stop();
pictureButtons.endEffectsStarted();
hasBeenInit = true;
initCamera();
//private var numTimes:uint = 0;
private function initCamera():void {
cameraButton.visible = true;
cameraButton.enabled = true;
acceptButton.enabled = false;
retakeButton.enabled = false;
acceptButton.visible = false;
retakeButton.visible = false;
//front camera loads if they have one and it's an iOS device.
var a:Array = Camera.names;
var camName:String = "";
var isAndroid:Boolean = false;
for(var i:uint = 0; i < a.length; i++) {
camName = a[i];
if(camName.indexOf("Front") != -1) {
break;
//test if android as right now only the back camera
///works on that platform.
if(Capabilities.version.indexOf('AND') != -1) {
this.camera = Camera.getCamera();
isAndroid = true;
else if(camName.indexOf("Front") != -1 &&
!isAndroid) {
this.camera = Camera.getCamera("1");
else {
this.camera = Camera.getCamera();
if(!Camera.isSupported) {
//todo
if(camera.muted) {
//todo
//following works on droid but is not working in iPod...
//camera.setMode(
//pictureButtons.contentWidth + this.width,
//pictureButtons.contentHeight + this.height, 30, true);
//the code below works on both platforms.
var ch:Number = Capabilities.screenResolutionY;
var cw:Number = Capabilities.screenResolutionX;
var vidh:Number = ch;
var vidw:Number = cw;
if(ch > cw) {
//in this case, the device must be registering in the portrait mode
//multiply eveything by 2 and switch orrientation...
vidw = ch * 2;
vidh = cw * 2;
camera.setMode(vidw, vidh, 30, false);
//android dimensions have to be doubled no matter what
else if(!(ch < cw) && isAndroid) {
vidw = cw * 2;
vidh = ch * 2;
camera.setMode(vidw, vidh, 30, false);
else {
//otherwise, everything should already be double and there's no need to switch
//width and height like there is above.
//need to test that this remains the case with ipod but can't seem to get ipod
//orientation to report other than "rotatedRight" no matter how the device is held.
camera.setMode(vidw, vidh, 30);
vidComponent.height = vidh;
vidComponent.width = vidw;
this.video = new Video();
video.width = vidComponent.width;
video.height = vidComponent.height;
video.attachCamera(camera);
vidComponent.addChild(video);
vidComponent.visible = true;
]]>
</fx:Script>
<mx:UIComponent id="vidComponent" x="0" y="0" width="100%" height="100%"/>
    <s:Image id="capturedImage" x="0" y="0"
             width="100%" height="100%"
             visible="false"/>
    <s:SWFLoader
        id="pictureButtons"
        x="0" y="0"
        width="100%" height="100%"
        scaleContent="true"
        source="@Embed('assets/SignUpPicButtons.swf')"
        creationComplete="{loadSWF()}" autoLoad="false"
        />   
    <s:SWFLoader
        id="busyLoader"
        x="0" y="0"
        width="100%" height="100%"
        scaleContent="true"
        source="@Embed('assets/CheckingSWF.swf')"
        autoLoad="false"
        />
    <s:SWFLoader
        id="invisibleBusy"
        x="0" y="0"
        width="100%" height="100%"
        scaleContent="true"
        source="@Embed('assets/InvCheckingSWF.swf')"
        autoLoad="false"
        />
</s:View>
Let me know if you want the SWF's required to run this code.

Similar Messages

  • I just opened my new ipad2 32GB.  I can't get off the screen for language choice!  How do I get to the correct screen to begin using it?

    I just opened my new ipad2-32GB.  It is connected to my macbook pro and itunes is opened.  But it is stuck on a screen for language choices.  How do i get to the correct screen to begin using it?

    yes, thanks.  I needed to reset using the power button and home button and hold for longer than i thought.  After some serious worry (I'm an electronic illiterate!) I do have everything working and synced with my laptop and phone. 
    I am glad to have discovered the "support community" site

  • Can't get mobile device to auto configure the active sync server

    Hello
    I am trying to get my costumer mobile devices to auto configure the active sync server name so they don't have to type it in. I believe I have everything in place Certificates are fine. I populated the external url on the active sync
    object in Exchange.
    DNS is set up correct. I ran the Exchange Connectivity Analyzer and it runs perfectly. The only test step if fails on is the first attempt to contact the autodiscover service using just the domain name and that is because we have a
    record in DNS so our domain name points to our public web server but all the other tests run fine. At the end, it even displays the xml file contents and shows me the external url of the active sync object.
    I get a successful run but it first shows SSL certifiate of our public Web site and then hangs on the server config and then prompts me to enter in the server name and domain. My external url in Exchange looks like this:
    https://remote.domain.com/Microsoft-Server-ActiveSync
    Any Help??
    Eddie

    Thank you for replaying but there is already internal A record that points to Exchange server. Firewall, DNS external and internal are setup like this:
    Firewall:
    Port 443 and 25 points to Internal IP of our Exchange 2013 (only mail server in company).
    Port 80 not open.
    External DNS records:
    autodiscover.mydomain.com à points to our WAN IP
    remote.mydomain.com à points to our WAN IP
    mydomain.com à points to external online webhosting
    Internal DNS records:
    autodiscover.mydomain.com à points to ours Exchange 2013 internal IP
    Remote.mydomain.com à points to ours Exchange 2013 internal IP
    mydomain.com à points to external online webhosting
    Test form "ExchangeConnectivityTest.com" is Successful but with warnings.
    Warnings are about https://mydomain.com/AutoDiscover/AutoDiscover.XML
    because
    https://mydomain.com is
    pointing to website, which is hosted externally.
    Eddie

  • Correct screen sizes for wallpapers and games on V3m RAZR for Verizon?

    Does anyone know the correct file size (i.e. 176x144) for
    wallpapers and games built for a Razr on the Verizon network? I
    know that the Razr is 176x220, but I thought that I remember seeing
    somewhere that the wallpapers should be 176x144 and games should be
    176x204 because of the top banner that is locked on the screen.
    Please advise if you know for sure. The lastest doc that I read
    about Verizon said that the status bar took 16pixels. Does anyone
    know for sure?

    I read this from a brew device data sheet on the V3m:
    The display height is 220 pixels. The number of pixels for
    status area is 16 pixels in height, so the height for BREW
    application display area is (220-16)=204 pixels in height.
    I'm not sure about wallpapers though. It looks that the top
    bar and bottom bar are the same size. I would developer my
    wallpapers at 176x188 (assuming the bottom bar is 16 px as well).
    The secondary display is 96x66. Though, I'm not sure how you
    could access that, if you want to show a small version of a
    wallpaper when its closed.
    C

  • Get data with correct array size

    My VI is trying to rearrange the 2D array that I read from test.xls file, so that each function is get separated with there data in it.
    Look over the test.xls file that I have attached. It has 2 columns. Both contains couple functions designated with ) and (. So, ACU_PGM is considered a function. I have rearranged the data so when ACU_PGM (or PGM is selected) the data following it is data for PGM before another function starts, which is KEY and 500 in this case. Same way for all other functions. Each column always ends by );
    )ACU_PGM( )CAB_INP(
    KEY WRITE
    500 50
    )ACU_DIA( 3
    DM1 0
    1010.1 )CAB_CLC(
    0 WRITE
    PROTECT 50
    DM2 3
    101.23 0
    10 NA
    NA )CAB_CRX(
    ); TEMP_1
    3
    0
    The problem with my current design is I am initializing array with 0x0 size, once it gets the 1st function it gets initialized with that same size of that function array for that entire column's fnction, so it want take more elements if 2nd function in same column have more elements like in this case. ACU_DIA has 8 elements but it will only take 2 elements as ACU_PGM has 2 in it.
    Please look over the Get_function.Vi only half portion. I have instructions in text in Vi also. I saw that columns are not lookin good after I submit the question so please open test.xlx file to see actual data Thank you.Message Edited by Amy222000 on 06-02-2005 03:44 PM
    Attachments:
    get_function.zip ‏795 KB
    test.xls ‏14 KB

    Duplicate Post
    E. Sulzer
    Applications Engineer
    National Instruments

  • Installing 10.4.10 and cannot install Mobile Device Support. I have followed the documentation at the support pages and have totally cleaned out Apple software so that I could do a total clean "new" install. Still no success. Any suggestions?

    In trying to install iTunes 10.4.1.10 I could not get Apple Mobile Device Support to work. Following Apple support (docs Ht1923 ?71926 + TS1538 et al) cleaned out all Apple software for a "new" install. Still can not get Mobile Device Support to install. What am I missing?

    See also Troubleshooting issues with iTunes for Windows updates if you haven't already done so.
    After uninstalling iTunes and the related components it is useful to physically delete any files that may remain in the specified locations before attempting to reinstall.
    If that still doesn't work you could try downloading 7-Zip (free), or a free trial of WinRAR, and unpack the iTunesSetup.exe or iTunesSetup64.exe file into its components then try installing them individually in alphabetical order (don't try to install SetupAdmin.exe or iCloud.msi). AMDS might not install right now, but you may get a more useful error message as to why not, and you might be able to run iTunes even if you can't update your devices at this stage.
    Make sure you download a fresh copy of the installer as it was updated some time after the initial release.
    tt2

  • IM GETTING A MESSAGE ITUNES WAS NOT INSTALLED CORRECTLY. PLEASE REINSTALL. ERROR 7 (WINDOWS ERROR 1114) I TRYED TO REINSTALL IN APPLE SUPPORT BUT I GET TANOTHER MESSAGE. SERVICE APPLE MOBILE DEVICE FAILED TO START. VERIFY THATSUFFICIENT PRIVILEDGES TO STA

    I'm getting a n error message when I try to open Itunes. Itunes was not install correctly. Please reinstall itunes. Error 7 (Windows error 1114) This happened after I unsuccesfully tried to install an update. I have had itunes on this computer for three years. When I try to reinstall the latest version I get another message.Service Apple Mobile Device (Apple mobile Device) failed to start. verify that you have sufficient privileges to start system services. Abort, Retry, Ignore Does anyone know how to solve this problem?

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • I am unable to reinstall iTunes.  I get the message it was not installed correctly.  "Please reinstall itunes (Windows error 126)"  Also get "Apple Mobile Device failed to start.  Verify that you have sufficient privileges to start system services."

    I am unable to reinstall itunes.  I get the message that it was not installed correctly.  I HAVE DONE A SYSTEM RESTORE, I HAVE TRIED TO REINSTALL SEVERAL TIMES ALSO.  I get a error message that it's "Windows error 126".  Also get "Apple Mobile Device failed to start.  Verify that you have sufficient privileges to start system services." 
    Help!

    Click here and follow the instructions.
    (98993)

  • Apparently a recent update did not install correctly and we get a message: Service (Apple Mobile Device) failed to start. Verify that you have sufficient privileges to start system services. How do we fix?

    Apparently a recent update did not install correctly and we get a message: Service (Apple Mobile Device) failed to start. Verify that you have sufficient privileges to start systen services, How do we fix this?

    Solving the iTunes Installation Problems in Windows
    1. Apple has posted their solution here: iTunes 11.1.4 for Windows- Unable to install or open - MSVCR80 issue.
    2. If the Apple article does not fully resolve the problem for you, then try Troubleshooting issues with iTunes for Windows updates - MSVCR80.

  • Itunes will not download. gets close but then a screen pops up saying ' Service apple mobile device failed to start. Verify that you have sufficient privilages to start systme services'.  Please HELP!!

    gets close but then a screen pops up saying ' Service apple mobile device failed to start. Verify that you have sufficient privilages to start systme services'.  Please HELP!!

    Try the following user tip:
    Troubleshooting issues with iTunes for Windows updates

  • Trying to sync iPhone to pc but keeps getting internal device error on screen, also showing only 4gb size instead of 32gb. Uninstalled iTunes from pc and reloaded. Powered back up and all songs and info still in place. Anyone had this problem before?

    Trying to sync iPhone to pc but keeps getting internal device error on screen, also showing only 4gb size instead of 32gb. Uninstalled iTunes from pc and reloaded. Powered back up and all songs and info still in place. Anyone had this problem before?

    Doublechecking something Emcee. I see you've got Windows 7 x64, so I'm assuming you've got at least 4 GB of RAM. Do you also have an NVIDIA USB EHCI chipset on that PC? If so, see the following Microsoft document:
    [You encounter problems when you move data over USB from a Windows 7 or Windows Server 2008 R2-based computer that has an NVIDIA USB EHCI chipset and at least 4GB of RAM|http://support.microsoft.com/kb/976972]

  • ITS mobile - Screen size on mobile device is too small

    Hi,
    I'm not able to change the screen size of my ITS Mobile application.
    If somebody can help me ...
    Here are the data:
    Internet service parameters
    ~DYNPRO_COMPRESSION : 1
    ~GENERATEDDYNPRO : 0
    ~ITSMOBILE : 1
    ~ITSMOBILEELEMFACTOR : 9
    ~ITSMOBILEELEMUNITS : px
    ~SOURCES : ZSAPLOG_MOBILE,ITSGENMOBILE4
    ~THEME : 99
    ~TRANSACTION : ZSAPLOG_MOBILE
    Internet service templatesGenerating style: MOBILE4 (Mobile Device (No HTML tables))
    ICF service - GUI Configuration
    ~THEME : 99
    ~TRANSACTION : ZSAPLOG_MOBILE
    ~ITSMOBILE : 1
    ~SOURCES : ZSAPLOG,ITSGENMOBILE4
    ~ITSMOBILEELEMFACTOR : 9
    ~ITSMOBILEELEMUNITS : px
    ~POPUPS : 1
    ~SHOW_SYSTEM_MODAL : 1
    ~STYLE : DHTML
    LRFMDscreen size is set to 16x20ITS
    Versions
    SAP_BASIS : SAPKB73108
    SAP NETWEAVER : SAP EHP3 FOR 7.0
    Mobile device
    Model : PIDION HM50 E
    CPU : Samsung Electronics(R) S5PV210
    OS : WEHH 6.5 Professional
    VER : Windows CE 5.2.29077
    Thanks for your help
    Philippe

    Perhaps an option to set the default font for discussion threads in the user preferences would be the best idea. One would think however that the Jive developers would have come up with something like that already.
    For what it's worth:
    http://www.w3.org/QA/Tips/font-size
    Do not specify the font-size in pt, or other absolute length units for screen stylesheets. They render inconsistently across platforms and can't be resized by the User Agent (e.g browser). Keep the usage of such units for styling on media with fixed and known physical properties (e.g print).
    Once again, I wonder about Jive development. Anyway, 10 pt is not best practice. It's standard for printed media, but not for screens. A search in Google shows that most recommend 16 pixels or more. Not sure what this is in points. I think 10 points is about 12 pixels, depending on screen dpi/ppi. I cannot imagine how tiny 10 pt must look on any of the high resolution Retina displays, which have twice or more density than conventional 72 dpi.

  • OA Framework page (custom) does not shrink to mobile device screen size.

    Hi,
    OA Framework page (custom page) using IE6 had application disconnection problem.
    So using IE6.1 beta/IE6.5 for OA Framework page (custom page) does not shrink/fit to the mobile device screen size. Means user have to scroll to the right/bottom every time. IE is set as a Mobile device (and not the desktop).
    We have tried using following Meta Tag (with different content values) to inform the browser that this is a mobile device. But this has not worked.
    pageContext.putMetaTag("MOBILEOPTIMIZED","<META name=\"MobileOptimized\" content=\"176\">");
    How we can fix this issue?
    Thanks in advance.
    Nilesh

    Hi,
    What you are trying to do, I could not understand.
    Apps Schema has all synonyms for almost all the objects in other schema if you will not specify any schema name the it will synonyms created in apps. For not using mention like this shema_name.object_name then it will fetch data from mentioned schema.
    Regards,
    Reetesh Sharma

  • Suddenly iTunes doesn´t work. Trying to reinstall I get error messages: "R6034 attempt to load C runtime library incorrectly", "Cannot start Apple Mobile device", "Not installed correctly Error7 (Windows error 1114)". What to do?

    Suddenly iTunes didn´t function. Trying to reinstall Ifirst tried to delete the program and all iTunes files, but ITunes Helper could not be deleted. After installation (with anti virus disconnected) the following error messages come up: "MS Visual C++ Runtime Library R6034 - attempt to load C routine library incorrectly", "Cannot start Apple Mobile Device", "Not correctly installed. Error 7 (windows error 1114" What to do?

    See Troubleshooting issues with iTunes for Windows updates.
    tt2

  • ITS Mobile screen sizes too small on iPhone device

    Hi Everybody,
    I am facing the some problems relating to screen sizes on iphone mobile. The ITS service and the templates were working fine at the desktop level..But, in iPhone,screen sizes are too small to view.We need to zoom it and enter.I have tried with screen format 16X20 and 16X20ITS.
    Can any body provide the solution to fix the problem?
    Regards,
    Mahesh

    You must have a very high resolution screen, also called HiDpi.
    If you have Photoshop CC 2014, you can go to Edit > Preferences > Experimental Features and checkmark "Scale UI 200%"
    If you have CC, CS6, or below, there is no way to scale the UI as of yet. There may not be. These products are no longer being updated.
    At best I can recommend reducing the resolution down to around 1400 px horizontal. That's not the native resolution and defeats the purpose of having a Hidpi screen.
    So only thing left aside from returning the laptop, is to work with a large external monitor, or for $10/monthly, join the Photography Plan and you can use CC 2014 and the 200% UI.

Maybe you are looking for