I want to load the pages that I have in the app in WebView, yes. The manner I do this, so long as it does not alter appearance or interface, is fine. I currently have the following below. You'll notice a couple commented out lines where I was fiddling with code, but was unable to get it to work.
function OnStart()
{
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "linear", "VCenter,FillXY" );
//Create a web control.
web = app.CreateWebView( 0.8, 0.8 );
web.SetOnProgress( web_OnProgess );
lay.AddChild( web );
//Create horizontal sub-layout for buttons.
layHoriz = app.CreateLayout( "linear", "Horizontal" );
//Create 'Local' button.
btnLocal = app.CreateButton( "Local" );
btnLocal.SetOnTouch( btnLocal_OnTouch );
layHoriz.AddChild( btnLocal );
//Add horizontal layout to main layout.
lay.AddChild( layHoriz );
//Add layout to app.
app.AddLayout( lay );
}
//Called when user touches 'Local' button.
//(We could use a url like "file:///sdcard/MyPage.htm")
function btnLocal_OnTouch( item )
{
app.ShowProgress( "Loading..." );
//web.LoadUrl( item + ".html" );
//web.LoadUrl( "file:///Sys/Internal Storage/Droidscript/page.js/Tips Guide.htm" );
web.LoadUrl( "Html/Tips Guide.html" );
}
//Show page load progress.
function web_OnProgess( progress )
{
app.Debug( "progress = " + progress );
if( progress==100 ) app.HideProgress();
}
I am building directly off the WebView sample, but I just need to get it to work and allow me to display my pages before I can make it my own.