launching wap browser with URL
I'm trying to launch the WAP Browser (wmlBrowser.app on the device, browser.app on the emulator) at a local file; and I'm having problems. In fact I'm having problems launching it with a URL at the moment...
The code I've found (from here somewhere) is:
void CMyDocument::LaunchURL(CMyString& aLink)
TPtr url((unsigned short *)aLink.Cstr(), aLink.Size());
HBufC * arg = HBufC::NewLC(url.Length()+3);
*arg = _L("4 ");
CleanupStack::PopAndDestroy(2); // cmdLine, arg
This launches the WAP browser, and seems to try to launch the URL passed in - but (even before trying to connect) says that the URL is invalid. Does anyone know what format is valid? I've tried a few variations but the error always pops up saying "check url"
And beyond that... does anyone know how (if?) I can point it at a .wml deck on the c: drive?
And finally... does anyone know what the other launch codes are? '4' in the above code seems to be the magic number for launching a URL... so what about 0, 1,2 and 3???
I've been doing some more investigation... and have got a tiny bit further, maybe.
If I use quotes around the URL in the document, things change. So I use:
The emulator shows the name as it's passed in (in an info message thingy), and the phone doesn't complain any more... but it doesn't actually make the brwoser launch anything...
Am I realy going to have to mask the browser app with my own and grab the command line when it's launched from the SMS app?????
Try removing the " \" " before the http. I got this to work on the 3650 device. Didn't try it in the emulator.
AppToLaunch = \\system\\apps\\browser\\browser.app;
iDoc = _L("4 http://wap.yahoo.com/");
CApaCommandLine* cmdLine = CApaCommandLine::NewLC();
if (iDoc != _L(""))
handle = ls.Handle();
Hi, there is a bug with this method, if the wap browser is already open, the browser will be restored with his current state since the OS will not restart the application.
So the command line arguments are ignored and the url is never sent to the browser.
Does anyone know how to solve that?
everything is explained in the document "utilizing external application views" from nokia
I tried what was suggested by the "Utilizing External Application Views" for launching WAP but it doesn't seem to work. If it is not currently running, it will launch WAP but it will just freeze and you have to re-boot.
If WAP is running, I get a "System Error" but it still launches the new URL.
Any ideas or thoughts? Below is a snippet of code of how I am implementing it.
if(iSettings->iAppModuleList[iSelectedIndex]->iDisplayName == _L("WAP"))
HBufC* param = HBufC::NewLC( 20 );
TApaTaskList taskList (CEikonEnv::Static()->WsSession());
TApaTask task = taskList.FindApp(id);
HBufC8* param8 = HBufC8::NewLC(param->Length());
appArcSession.StartDocument(*param, TUid::Uid(AppUid), id);
Attached please find my sample code. It works beautifully. Should you have any problems, please let me know.
Hope this solves your problem!
Getting browser to work on emulator
What does one need to do to get the programatic browser opening to work on the Series 60 emulator? Do I have to install or configure some WAP proxy thing?
I already have the sockets example working using the virtual serial port, etc. I am running the emulator on Windows XP Pro.
...sure would be nice to be able to delete posts...
Last edited by dpifko; 2003-09-08 at
hi! i've used the function provided above to launch a WAP browser. It works fine, but how could i detect if the user has finished with it and returned back to the application?
The code is as follows:
aAddr = _L("4 http://wap.yahoo.com/");
TUid id( KPhoneUidWmlBrowser );
TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
TApaTask task = taskList.FindApp( id );
if ( task.Exists() )
HBufC8* param8 = HBufC8::NewLC( aAddr.Length() );
param8->Des().Append( aAddr );
task.SendMessage( TUid::Uid( 0 ), *param8 ); // UID is not used
CleanupStack::PopAndDestroy( param8 );
if ( !iApaLsSession.Handle() )
User::LeaveIfError( iApaLsSession.Connect() );
User::LeaveIfError(iApaLsSession.StartDocument( aAddr, KPhoneUidWmlBrowser, thread ) );
DoSomething(); // !!! <------------------- i want this to execute only after the user has exited the browser and back to the application.
Currently, DoSomething() executes once the Services is launched. Then it'll show error.
If the browser supported embedding, you could request for exit notification via NotifyExit(). As of Series 60 v1.x, the browser does not support embedding.
Please tell what you would like to achieve with browser exit detection. For some (view-based) applications it might be feasible to use DoActivateL() to detect when the application view is reactivated after launching browser.
Thanks for the reply.
I want to start a socket connection and send a file after the user exits from the browser. Now the socket part prompts for access point selection once services is started. Then it closes with error.
How can i achieve this?
Launch browser ??
Really thanks for all the useful tips here. May I know how to launch the browser to directly go to the specific wap site without go through the bookmark ?
UID and NokiaOK
I have one question about NokiaOK.
In the "launchwap.zip" sample code,
it uses UID "0x10008D39" to launch the wap browser.
Will we pass the NokiaOK if we do like this??
(all phones use the same UID value??)
If not, anybody has other good method??