You need to display a web page within your Android application and would like to include basic web browser functionality including back and forward buttons.
You can use flash.media.StageWebView to include a native web browser within your application.
The StageWebView class allows you to include a native web browser within your Android application. Let's take a look at the example below.
The components in this example include three Buttons which will be used for navigation and a TextInput used to hold the currently URL of the web browser.
An event listener is added for applicationComplete that will call the applicationCompleteHandler function. Within this function we first test to see if StageWebView is supported. If it is, we create a new StageWebView with the variable name of stageWebView. Next, we need to create a viewPort to hold the stageWebView. This is accomplished by defining a Rectangle to hold it. The new Rectangle is sized to fill most of the initial screen real estate by doing a little math on the stage width and height properties. The stageWebView's stage property is then assigned to the stage of the application. To allow us to update the current location being displayed within our TextInput, an event listener is added to track user initiated changes within the stageWebView. Finally, the loadURL method is called and set to the location we have assigned as the default within the TextInput.
As mentioned earlier, there are three buttons within this application to control the browser behavior. The first is the back button which when clicked calls the backButtonHandler function. This function calls the stageWebView.historyBack() method which will load the last item in the stageWebView's history.
The second is the forward button which when clicked calls the forwardButtonHandler function. This function calls the stageWebView.historyForward() method which will load the next item in the stageWebView's history. Finally next to the TextInput is the GO button which when clicked will call the goButtonHandler fucntion. Within this function the loadURL method of the stageWebView is called and the text property of the TextInput is passed.
Thats all there is to creating a web browser with forward and back button navigation.

Please consider purchasing Developing Android Applications with Flex 4.5.
Here is the code:
<?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 "
applicationComplete="applicationCompleteHandler(event)" >
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
private var stageWebView:StageWebView;
protected function applicationCompleteHandler(event:FlexEvent): void
{
if(StageWebView.isSupported== true){
stageWebView = new StageWebView();
stageWebView.viewPort = new Rectangle(5,80,stage.width-10,stage.height-90);
stageWebView.stage = this.stage;
stageWebView.addEventListener(LocationChangeEvent.LOCATION_CHANGE,
locationChangedHandler);
stageWebView.loadURL(urlAddress.text);
} else {
urlAddress.text = "StageWebView not supported" ;
}
}
protected function backButtonHandler(event:MouseEvent): void
{
stageWebView.historyBack();
}
protected function forwardButtonHandler(event:MouseEvent): void
{
stageWebView.historyForward();
}
protected function goButtonHandler(event:MouseEvent): void
{
stageWebView.loadURL(urlAddress.text);
}
protected function locationChangedHandler(event:LocationChangeEvent): void
{
urlAddress.text = event.location;
}
]]>
</fx:Script>
<s:Button id=" backButton" left=" 5" width=" 45" height=" 50"
label=" <" click="backButton_clickHandler(event)" />
<s:Button id=" forwardButton" left=" 55" width=" 45" height=" 50"
label=" >" click="forwardButton_clickHandler(event)" />
<s:TextInput id=" urlAddress" left=" 105" right=" 80"
height="50 " text="http://www.google.com " />
<s:Button id=" goButton" right=" 5" width=" 70" height=" 50"
label=" GO" click="goButton_clickHandler(event)" />
</s:Application>
Please consider purchasing Developing Android Applications with Flex 4.5.
+