Run Through of PlayBook Beta3 AIR SDK Updates

Posted on January 12, 2011 | 2 comments

Check out the latest development beta bits for developing applications for the PlayBook. Video covering the new Beta3 or BlackBerry Tablet OS SDK/Simulator 0.9.2 for Adobe AIR:

Run Through of PlayBook Beta3 AIR SDK Updates from Renaun Erickson on Vimeo.

Highlights:

  • Differences of old simulator and new simulator
  • New simulator portrait mode simulation
  • Sample HelloWorld application showing off blackberry-tablet.xml for custom splash screen and icon.

Here is the source Flex Hero application code for the application I used in the video:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               width="100%" height="100%"
               resize="application1_resizeHandler(event)"
               applicationComplete="application1_applicationCompleteHandler(event)">
    <s:layout>
        <s:VerticalLayout />
    </s:layout>

    <fx:Script>
        <![CDATA[
            import mx.events.FlexEvent;
            import mx.events.ResizeEvent;

            protected function application1_applicationCompleteHandler(event:FlexEvent):void
            {
                stage.scaleMode = StageScaleMode.NO_SCALE;
                stage.align = StageAlign.TOP_LEFT;
                lblOrientation.text += "init: " + stage.orientation + " w/h: " + stage.stageWidth + "/" + stage.stageHeight + " s: " + stage.scaleX + "\n";
                stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, stageOrientationChange);
            }
            private function stageOrientationChange(event:StageOrientationEvent):void
            {
                lblOrientation.text += "stageOrientationChange: " + stage.orientation + " w/h: " + stage.stageWidth + "/" + stage.stageHeight + " s: " + stage.scaleX +
                    "\n>>event.beforeOrientation: " + event.beforeOrientation +
                    "\n>>event.afterOrientation: " + event.afterOrientation;
               
            }

            protected function application1_resizeHandler(event:ResizeEvent):void
            {
                if (stage)
                    lblOrientation.text += "resize: " + stage.orientation + " w/h: " + stage.stageWidth + "/" + stage.stageHeight + " s: " + stage.scaleX + "\n";
            }
        ]]>
    </fx:Script>
    <s:Button label="Some Button" />
    <s:TextArea id="lblOrientation" width="100%" height="100%" />
</s:Application>
  • Srinivas Sama

    Hi Renaun, can you please post the sample application source code you have used to demonstrate the screen rotation monitoring.

    Thanks a bunch!!

    • http://www.renaun.com Renaun Erickson

      I put the source code in to the post above. enjoy!