Launch the browser, fetch a web page & obtain size of the page
Hi,
From my application, I can launch the web browser of 6600 phone and perhaps even tells it to fetch a web page. But is it possible to get the size (in bytes) of that web page including all embedded images?
All I want to do is to have an application that fetches different web pages and display their sizes. The HTTP client example fetches only the main page with one GET and response transaction. It does not try to further fetch the embedded objects.
Any suggestions are appreciated.
how to launch and fetch??
hi,
can u please tell me how to launch and fetch the web page??
thanks
Re: Launch the browser, fetch a web page & obtain size of the page
Hi manmli,
how did you launch thw web Browser through your application.
is it given In Series 60 SDk second edition?I searched for the same... but I couldn't get it.
Please tell me...
Re: Launch the browser, fetch a web page & obtain size of the page
Hi amolvcpp,
Like this
_LIT( KMyAppName, "c:\\system\\apps\\browser\\browser.app" );
CApaCommandLine* cmd = CApaCommandLine::NewL();
cmd->SetLibraryNameL( KMyAppName );
cmd->SetDocumentNameL( urlpath );
cmd->SetCommandL( EApaCommandOpen );
TThreadId threadid = EikDll::StartAppL( *cmd );
BR,
Sudhakar
Re: Launch the browser, fetch a web page & obtain size of the page
You can also refer to the pdf given in Forum Nokia which explains
each line of how to launch a browser with a URL from an application.
Refer to this link:
[url]http://www.forum.nokia.com/info/sw.nokia.com/id/fb030d76-e5f5-4a1d-ba7e-7d425ac8dd05/Utilizing_External_App_Views_v1_0.pdf.html[/url]
--
VVS.Naresh
--
Re: Launch the browser, fetch a web page & obtain size of the page
Thanks for your reply,
I have also done it in following way:which is very similar to what u have specified.
This I found in forum nokia technical libray.
void CWebarooContainer::LaunchBrowser()
{
//CEikonEnv::Static()->AlertWin(_L("LaunchBrowser() "));
RApaLsSession apaLsSession;
//const TUid KOSSBrowserUidValue = {0x1020724D};//defined in header
const TUid KOSSBrowserUidValue = {0x10008D39};
//param->Des().Copy(_L("4 http://www.google.com/"));
TUid id(KOSSBrowserUidValue);
TApaTaskList taskList(CEikonEnv::Static()->WsSession());
TApaTask task = taskList.FindApp(id);
if(task.Exists())
{
task.BringToForeground();
HBufC8* param8 = HBufC8::NewLC(param->Length());
param8->Des().Append(*param);
task.SendMessage(TUid::Uid(0), *param8); // UID not used
CleanupStack::PopAndDestroy(param8);
}
else
{
//CEikonEnv::Static()->AlertWin(_L("ElseTask "));
if(!apaLsSession.Handle())
{
User::LeaveIfError(apaLsSession.Connect());
}
TThreadId thread;
User::LeaveIfError(apaLsSession.StartDocument(*param, KOSSBrowserUidValue, thread));
apaLsSession.Close();
}
}
Only thing is that the ID they have mentioned was not working...
So I changed it to
const TUid KOSSBrowserUidValue = {0x10008D39};
Thanks And Regards,
AMOLVCPP
Re: Launch the browser, fetch a web page & obtain size of the page
On thing worth noting is, that when you make an HTTP request, you will not get a response that says what the size of that page is or the size of content it links to (which is fetched separately), such as external stylesheets, images, videos, etc.
So, until you fetch the whole page, and also all the items the page loads, the size will not known. That means your app would have to parse the HTML and see what other content needs to be fetched and get that, too.
Re: Launch the browser, fetch a web page & obtain size of the page
doe's anybody know how to fetch a web page ? and save it to a file?
Thanks
Re: Launch the browser, fetch a web page & obtain size of the page
I tried amolvcpp's code, the emulator crashed at thsi line:
TApaTask task = taskList.FindApp(id);
Does it mean FindApp is not supported by Emulator?
Btw, how to get UID of a built-in symbian browser?
Thanks!
Re: Launch the browser, fetch a web page & obtain size of the page
I always get "undefined identifier 'RApaLsSession'" when using this code... Do I need to import some header file? (I'm sorry, I'm new at Symbian development..)
Re: Launch the browser, fetch a web page & obtain size of the page
Yes, Symbian API-s reside in .h and .lib files - as API-s of any other C/C++ environment would do. If you search for RApaLsSession in the SDK Help, you will find the name of the files you need on the top of the help page.