Highlighted

AIR 23 Android screen size measurement error

Explorer ,
Oct 17, 2016

Copy link to clipboard

Copied

Compile our Android App with AIR22 and . .  .

This code:

public function getDeviceRectangle():Rectangle{

  var dr:Rectangle = new Rectangle(0, 0,

  Math.max(this.width, this.height),

  Math.min(this.width, this.height));

  return dr;

  }

Gives us  0  0 1024  552  for a Kindle fire which has a 1024 x 600 screen and Status Bar which cannot be removed

This works for us as we then scale the app to fit the available space.

Compile on AIR 23 and the same code returns   0  0   1024  600   which is the full screen ( including the android status bar )

Since many apps will use this code as starting point for scaling up their app to fit the many android resolutions it's important to know whether we're scaling to the available screen ( less the Android UI )

Note - I've also tried <fullscreen>true<fullscreen>  which throws a compile error.

TOPICS
Air beta

Views

519

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

AIR 23 Android screen size measurement error

Explorer ,
Oct 17, 2016

Copy link to clipboard

Copied

Compile our Android App with AIR22 and . .  .

This code:

public function getDeviceRectangle():Rectangle{

  var dr:Rectangle = new Rectangle(0, 0,

  Math.max(this.width, this.height),

  Math.min(this.width, this.height));

  return dr;

  }

Gives us  0  0 1024  552  for a Kindle fire which has a 1024 x 600 screen and Status Bar which cannot be removed

This works for us as we then scale the app to fit the available space.

Compile on AIR 23 and the same code returns   0  0   1024  600   which is the full screen ( including the android status bar )

Since many apps will use this code as starting point for scaling up their app to fit the many android resolutions it's important to know whether we're scaling to the available screen ( less the Android UI )

Note - I've also tried <fullscreen>true<fullscreen>  which throws a compile error.

TOPICS
Air beta

Views

520

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 17, 2016 0
Community Beginner ,
Oct 17, 2016

Copy link to clipboard

Copied

What does stage.stageWidth and stage.stageHeight return in your app? I always use those to measure the screen.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 17, 2016 0
maxddd LATEST
Community Beginner ,
Nov 18, 2016

Copy link to clipboard

Copied

I have the same problem.

With AIR 22   stage.stageWidth =  2560  stage.stageHeight = 1440 Capabilities.screenDPI = 640

Screenshot_20161118-175907.png

With AIR 23   stage.stageWidth =  2560  stage.stageHeight = 1334 Capabilities.screenDPI = 640

Screenshot_20161118-175243aa.png

If I press the HOME key to jump out and then back to APP, It will return to normal.

stage.stageWidth =  2560  stage.stageHeight = 1440 Capabilities.screenDPI = 640

My app.xml

  <initialWindow>

    <title>MJ16TW</title>

    <content>MJ16TW.swf</content>

    <visible>true</visible>

    <fullScreen>true</fullScreen>

    <autoOrients>true</autoOrients>

    <renderMode>gpu</renderMode>

    <systemChrome>standard</systemChrome>

    <transparent>false</transparent>

    <aspectRatio>landscape</aspectRatio>

  </initialWindow>

Smart Phone

Screenshot_20161118-180049.png

Please help me.

Thank you.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 18, 2016 0