Search

 

October 2010
S M T W T F S
« Sep   Nov »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Tags

Archives


« | Main | »

Is that HTML in your AIR on Android App? Yes it is!

By Rich Tretola | October 13, 2010
11,140 views

AIR on Android doesn’t have an HTML component like its desktop counterpart but there is a way to get HTML in your application. The StageWebView class can accomplish this for you. I have added this to my AIRonAndroid Browser application (version 0.0.4) so you can see it in action if you have an Android device.

I will be going through each screen within this app showing demo code very soon. For now, you can just play with the functionality and check out the snippet below.

:-)

Here is a small snippet for now:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
private var stageWebView:StageWebView;
private var rect:Rectangle;
private function init():void{
    rect = new Rectangle(0,190,width,height-90);
    if(StageWebView.isSupported==true){
        stageWebView = new StageWebView();
        stageWebView.viewPort = rect;
        stageWebView.stage = stage;                            
    } else {
        status.text = "StageWebView not supported";
    }              
}
private function setPage():void{
    stageWebView.loadURL("http://blog.everythingflex.com");
}

Topics: ActionScript 3, Adobe AIR, android, Flex | 5 Comments »

5 Responses to “Is that HTML in your AIR on Android App? Yes it is!”

  1. andy matthews Says:
    October 13th, 2010 at 4:16 pm

    Phonegap uses a local htdocs folder in it’s XCode project. Could the StageWebView component point to a local file as opposed to a remote one?

    Reply to this comment

  2. Quentin Says:
    October 13th, 2010 at 5:22 pm

    Looks cool!
    That “if(StageWebView.isSupported==true)” is a bit too much right? A simple “if(StageWebView.isSupported)” should be enough! My 2 cents.

    Reply to this comment

    Rich Tretola Reply:

    Yes, you are correct.

    Reply to this comment

  3. Jozef Chutka Says:
    October 14th, 2010 at 5:44 am

    StageWebView can be easily used for facebook authorization http://goo.gl/7Xzg

    Reply to this comment

  4. Jabari Says:
    February 3rd, 2011 at 7:49 pm

    Is it possible to reposition a StageWebView instance dynamically? I’m using it to load a banner at the bottom of my app. It is out of view when the device is turned horizontally.

    Reply to this comment

Comments