10-28-2010 05:56 AM
Jerome,
Would you mind posting a link to the RSS Feed reader sample you referenced? I looked through the forum but can't find it.
thanks, James
10-28-2010 08:18 AM
jamesharnedy wrote:Jerome - I went the route of using the command line tools (to avoid Flash Builder) but in my docs the qnx.media.QNXStageWebView package is not documented. How are you getting to it?
Thanks, James
Hi James, how did you get this stuff working?
I tried the HelloWorld Sample. Edited the HelloWorld-App.xml, amxmcl Helloworld.as, then this bb-airpackager...
The Simulator shows me "application loading" then this window closes again and nothing happens, nothing installed.
Thx
David
10-28-2010 08:23 AM
check the content of a bar file (unzip it), does it look reasonable?
10-28-2010 08:47 AM
David,
There is a very useful post on this here: http://supportforums.blackberry.com/t5/Tablet-OS-SD
See Harry's post with the shell script.
cheers
James
10-28-2010 09:15 AM
i tried this already, without any sucess.
Could you send me your modified HelloWorld source?
10-28-2010 12:17 PM - edited 10-28-2010 12:39 PM
package
{
import flash.display.Sprite;
import qnx.media.QNXStageWebView;
import spark.primitives.Rect;
import flash.geom.Rectangle;
public class mine extends Sprite
{
public function mine()
{
var webView:QNXStageWebView = new QNXStageWebView();
var rect:Rectangle = new Rectangle(0, 60, 1024, 680);
// Set layout
webView.stage = stage;
webView.viewPort = rect;
webView.autoFit = true;
// Functionality
webView.enableCookies = true;
webView.enableJavascript = true;
webView.enableScrolling = true;
// ...
getUrl('http://www.google.com'); // Home page preset
// ...
// getUrl method
function getUrl(url:String):void{
webView.loadURL(url);
}
}
}
}
There some code for your web start ;-).
(Thanks to JCarty Kudoos).
The Web browser looks great with the flash integration !.
Small question do, as we use a non documented class
import qnx.media.QNXStageWebView;
( http://www.blackberry.com/developers/docs/airapi/1
Do we just have to guess our way through the eclipse references in the SDK or can we soon expect the airapi document to be extended with the newer classes.
The other thing I found I can't open the source of any of the classes containted in the qnx packages, though I can open the Adobe Air classes. is this a misconfiguration on my side and/or intended ?
Last thought: How fixed is the Adobe Air and browser implementation, should we keep in mind there are still (minor/major) changes being done to the Web runtime ?
(should I open another thread for this)
10-28-2010 08:09 PM - edited 10-28-2010 08:11 PM
For anyone looking for the RSS reader app:
http://na.blackberry.com/eng/developers/tablet/RSS
Download it and import as a project in Flash Builder.
Don't have Builder? Rename RSSReader.fxp to RSSReader.zip and extract to examine source code.
10-28-2010 11:58 PM - edited 10-28-2010 11:58 PM
Epic Jerome, I remember reading it in Twitter and was blown away. Showed it to some friends and they were amazed as well. They don't need to know it was a simple program. ![]()
I still need to get the SDK installed (as a student I got Flash Builder 4 free but the SDK says it is missing some folders.
)
10-29-2010 09:48 AM
Hi,
I'm wondering why the rectangle is set larger than the PlayBook resolution.
Harry
10-31-2010 01:23 PM
package
{
import flash.display.Sprite;
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.*;
import flash.events.MouseEvent;
import flash.geom.Rectangle;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;
import org.casalib.util.AlignUtil;
import org.dp.display.Marco; // Custom class for graphics, create a rectangle. Create yours
import qnx.media.QNXStageWebView;
import qnx.ui.buttons.Button;
import qnx.ui.text.TextInput;
//
public class Navigator extends Sprite
{
private var _header:Marco;
private var _textInput:TextInput;
private var _textFormat:TextFormat = new TextFormat;
private var _buttonClose:Button = new Button;
//
public function Navigator()
{
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
//
_header = new Marco(stage.stageWidth,50,0,0,0x000000,0,0x000000,
_textInput = new TextInput;
//
_textInput.width = stage.stageWidth - 200;
_textInput.addEventListener(KeyboardEvent.KEY_DOW
//
_buttonClose.width = _buttonClose.height;
_buttonClose.addEventListener(MouseEvent.CLICK,_b
//
// _textInput.addEventListener(MouseEvent.CLICK,_tex
// _textInput.border = true;
//_textInput.autoSize = TextFieldAutoSize.LEFT;
// _textFormat.size = 12;
//
// _textInput.defaultTextFormat = _textFormat;
//
AlignUtil.alignMiddleLeft(_textInput,new Rectangle(_header.x,_header.y,_header.width,_heade
AlignUtil.alignMiddleRight(_buttonClose,new Rectangle(_header.x,_header.y,_header.width-10,_he
// AlignUtil.alignMiddleLeft(_textInput,new Rectangle(20,0,_header.width,_header.height));
//
addChild(_header);
addChild(_textInput);
addChild(_buttonClose);
}
//
private function _textInput_onKeyDownHandler(evt:KeyboardEvent):voi
if(evt.keyCode==13){
getFeed();
}
}
//
private function _buttonClose_onClickHandler(evt:Event):void{
stage.nativeWindow.close();
}
//
private function _textInput_onClickHandler(evt:Event):void{
}
//
private function getFeed():void{
var url
tring = _textInput.text;
//THE WEBVIEW COMPONENT IS STILL UNDER DEVELOPMENT, THIS IS STRICTLY A SAMPLE AND NOT TO BE TAKEN AS THE FINAL VERSION
//OF THE WEBVIEW COMPONENT - the component does contain some bugs and usability issues currently
var rect:Rectangle = new Rectangle(0, _header.height,stage.stageWidth, stage.stageHeight);
var webView:QNXStageWebView = new QNXStageWebView();
//
webView.stage = stage;
webView.viewPort = rect;
webView.autoFit = true;
webView.enableCookies = true;
webView.enableJavascript = true;
webView.enableScrolling = true;
webView.loadURL(url);
}
}
}