Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
New Developer
Posts: 5
Registered: ‎10-25-2010
My Device: Not Specified

Re: Web Browser?

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

Highlighted
New Contributor
Posts: 8
Registered: ‎10-28-2010
My Device: Not Specified

Re: Web Browser?

 


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

 

Contributor
Posts: 35
Registered: ‎10-25-2010
My Device: Not Specified

Re: Web Browser?

check the content of a bar file (unzip it), does it look reasonable?

New Developer
Posts: 5
Registered: ‎10-25-2010
My Device: Not Specified

Re: Web Browser?

David,

 

There is a very useful post on this here: http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/How-to-compile-the-sample-apps-tha...

 

See Harry's post with the shell script.

 

cheers

James

New Contributor
Posts: 8
Registered: ‎10-28-2010
My Device: Not Specified

Re: Web Browser?

i tried this already, without any sucess.

Could you send me your modified HelloWorld source?

Developer
Posts: 119
Registered: ‎05-27-2010
My Device: 9900
My Carrier: Vodafone NL

Re: Web Browser?

[ Edited ]

 

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.0.0/index.html )

 

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)

 

@reumerd-- @BBDevGroupNL -- about me
If you like it, LIKE it ;-) ----- If it's solved, press solved ! --- If you solved it yourself, please let us know! We might have the same problem!
Developer
Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Web Browser?

[ Edited ]

For anyone looking for the RSS reader app:

 

http://na.blackberry.com/eng/developers/tablet/RSSReader.fxp

 

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.

Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: Web Browser?

[ Edited ]

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. Smiley Wink

 

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. Smiley Mad)

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 153
Registered: ‎10-26-2010
My Device: Bold 9900
My Carrier: AT&T

Re: Web Browser?

Hi,

 

I'm wondering why the rectangle is set larger than the PlayBook resolution.

 

Harry

--------------
Accepted PlayBook Applications: Marmi-doos, BASIC, Run and Hide, SuperClip
Accepted OS4-7 SmartPhone App: KeepLightOn
New Contributor
Posts: 3
Registered: ‎10-31-2010
My Device: Not Specified

Simple Web Browser?

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,0.85);
            _textInput = new TextInput;
            //
            _textInput.width = stage.stageWidth - 200;
            _textInput.addEventListener(KeyboardEvent.KEY_DOWN,_textInput_onKeyDownHandler);
            //
            _buttonClose.width = _buttonClose.height;
            _buttonClose.addEventListener(MouseEvent.CLICK,_buttonClose_onClickHandler);
            //
        //    _textInput.addEventListener(MouseEvent.CLICK,_textInput_onClickHandler);
        //    _textInput.border = true;
            //_textInput.autoSize = TextFieldAutoSize.LEFT;
        //    _textFormat.size = 12;
            //
        //    _textInput.defaultTextFormat = _textFormat;
            //
            AlignUtil.alignMiddleLeft(_textInput,new Rectangle(_header.x,_header.y,_header.width,_header.height));
            AlignUtil.alignMiddleRight(_buttonClose,new Rectangle(_header.x,_header.y,_header.width-10,_header.height));
            //    AlignUtil.alignMiddleLeft(_textInput,new Rectangle(20,0,_header.width,_header.height));
            //
            addChild(_header);
            addChild(_textInput);
            addChild(_buttonClose);
        }
        //
        private function _textInput_onKeyDownHandler(evt:KeyboardEvent):void{
            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 urlSmiley Frustratedtring = _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);
        }
    }
}