12-02-2010 09:24 AM
The new SDK (0.9.1) does not add any new features, just support of Burrito and some very minor bug fixes.
Only about a month to go (early January) to submit to App World. A lot has to happen between now and then. I hope everyone is ready to hook themselves to some iv caffine drip ![]()
12-02-2010 01:03 PM
I noticed that there is no size set for any of these button:
qnxButton = new qnx.ui.buttons.Button();
qnxButton.x = 10;
qnxButton.y = 10;
qnxButton.setSize(75,42);
this.addChild(qnxButton);
I have a qnx button on top of a sprite object and it shows up fine. ![]()
See if that fixes it.
12-02-2010 01:18 PM
You can use MX components, even with 0.9.0.You just need a top level application. I'm working on an app right now and it's exactly like developing for AIR anywhere else.
I created a normal AIR application and then switched the project to use the SDK for Blackberry. There was some problem creating a project using that SDK that was anything but a .as file for the main app.
And add the compiler args (your library path may vary):
-locale en_US -library-path+="C:/Program Files/Adobe/Adobe Flash Builder 4/sdks/blackberry-tablet-sdk-0.9.0/frameworks/loca
And configure a launch profile of course.
Then you should be able to deploy something like this:
<?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"
xmlns:mx="library://ns.adobe.com/flex/mx"
backgroundColor="#000000" >
<mx:Button label="Close" click="stage.nativeWindow.close()"/>
</s:Application>
12-02-2010 01:32 PM
Have you been able to check the resulting SWF filesize from this method to the Sprite only method? I dont have the number with me, but the file size difference was significant (~2x) and in the case of WindowedApplication base class, the load time in the simulator was just too slow. I would rather work in MXML land, because I feel I am writing less code and have increase productivity, but the download and loadup by this method did not seem to warrant to proceed further in that direction. If you can show that an MXML approach is still light weight, I would love to change gears and go back to that approach.
Also had trouble setting the SWF parameters above the main Sprite definition in any approach other than the "standard" approach.
12-02-2010 01:46 PM
If you want to use MX or Spark components, you MUST have an Application component as Root.
MX and Spark components inherits from UIComponent class which initialise a lot of things and communicate with a top Manager. It is not possible to add Sprites on MX or Spark components (except UIComponent with some tricks), because they don't use the same display events. And you can't use MX or Spark components on Sprites, because components need an initialisation to display, and Sprite can't do that.
When developping real desktop AIR programs or web Flex programs, if you use Shared Libraries, your SWF will be >40kB. if you add static librairies, it will be bigger.
12-02-2010 01:57 PM - edited 12-02-2010 02:00 PM
@jtegen
Planning to check size of similar function apps with Sprite + QNX and Spark, but apps shoul be substantial not just one button in a container!
Will post my results here.
I agree with you that using x,y for mobile devices is bad, I always use relative coordinates, containers (like vbox,hbox) and non absolute layour managers.
Always runinng orientation test to see how UI looks with different orientation.
12-02-2010 02:53 PM - edited 12-02-2010 02:53 PM
Forgot to mention, new Burito SDK actually has <MobileApplicaiton/> root element, I suspect there are bunch of mobile optimised components as well. As part of my test I will check how big is Mobile optimised Spark Application.
12-02-2010 03:07 PM - edited 12-02-2010 03:08 PM
@jtegan
Note in the above example, I'm using Application rather than WindowedApplication.
Of course the SWF loads quickly, but the Flex Init time is a few seconds, so I put a preloader on it to get rid of the 'white box' progress bar for the few seconds it's shown. I'm fine with it not being absolutely instantaneous. It doesn't take as long as Firefox does to launch on my desktop, ![]()
-=Cliff>
12-02-2010 05:05 PM
I just did a quick sample between Application root class and Sprite root class. The Sprite root class to just show a label is 127KB. The Application based application is 540KB; 425% larger.
Any suggestions to get it smaller?
Sprite:
import qnx.ui.text.Label;
[SWF(height="600", width="1024", frameRate="30", backgroundColor="#FFFFFF")]
public class SampleAway extends Sprite
{
public function SampleAway()
{
this.stage.nativeWindow.visible = true;
var label : Label = new Label();
label.text = 'Hello World';
addChild( label );
}
}
Application:
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="1024" height="600"> <s:Label text="Hello World" /> </s:Application>
12-02-2010 05:22 PM
You can try to use shared libraries with Flex. It's an compiler option.