var picker,view,hv={}; //Called when application is started. function OnStart() {     //Create a layout with objects vertically centered.     var lay = app.CreateLayout( "linear", "Left" );       //Create a full screen scroller      var scroll = app.CreateScroller( 1.0, 0.95 );      lay.AddChild( scroll );         //Create a layout inside scroller.      var layScroll = app.CreateLayout( "Linear", "Left" );      scroll.AddChild( layScroll );             view=app.CreateWebView(1.5,0.95);     layScroll.AddChild(view);     //Add layout to app.         app.AddLayout( lay );     var path="/sdcard/DroidScript/Hello World/Img/Hello World.png";     hexViewStart(path,view); } function hexViewStart(fullPath,webView) {   hv={chunksize:1024,path:fullPath};   hv.webView=webView;   hv.file = app.CreateFile( hv.path, "r" );   hv.len = hv.file.GetLength();    hv.html="

"+fullPath+"

\n";   hv.file.Seek( 0 );   app.ShowProgress("Loading");   hexViewChunk(); } function hexViewChunk() {   var pos=hv.file.GetPointer();   var whole = hv.file.ReadData( hv.chunksize,"int" );   if(whole == undefined)   {        hexViewEnd();        return;   }   var bull="•";   var int,hex,asc,hbuff,abuff,row;   do   {     var data = whole.slice(0,8);     whole=whole.slice(8);     //var data = file.ReadData( 8,"int" );     if(data==undefined) break;     var len = data.length;     hbuff="";     abuff="";     var pos8="";     for(var i=0;i31 && int<127)          asc=String.fromCharCode(int);       if(asc=="<")asc="<";       hbuff+="";     row=""+pos8+hbuff+abuff+"";     if(len>0) hv.html +=row+"\n";     pos+=len;   }   while(len > 0);   setTimeout("hexViewChunk()",1); } function hexViewEnd() {   hv.html+="
"+       ("00000000"+       pos.toString(16)).slice(-8).toUpperCase() +       ""+hex.toUpperCase()+"";       abuff+=asc;     }     abuff+="
";   app.HideProgress();   hv.webView.LoadHtml(hv.html);   hv.file.Close(); } function pickit() {     if( ! picker )     {        picker = new FilePicker(openit,"/");        picker.SetFolder("/sdcard");        picker.SetHideFiles(false);     }     picker.Show(picker);      } function openit(pth) {      hexViewStart(pth,view); }