| Reply | « Previous Thread | Next Thread » |
|
Hi, all
I would like to open the specified URL in my application. I hope to start the web browser built in mobile phone to open the URL. My aplication will run on s60 2.0 fp3 SDK. What shoule I do? Thank you. |
| Casper1314 |
| View Public Profile |
| Find all posts by Casper1314 |
|
Quote:
Code:
#define KPhoneUidWmlBrowser 0x10008D39
TAny CLaunchBrowser::LaunchBrowser(const TDesC& aBrowserUrl)
{
TUid id =
{
KPhoneUidWmlBrowser
};
RWsSession session;
TInt test = session.Connect();
if (test != KErrNone)
{
session.Close();
return;
}
TApaTaskList taskList(session);
TApaTask task = taskList.FindApp(id);
HBufC8* param8 = NULL;
param8 = HBufC8::NewL(aBrowserUrl->Length());
param8->Des().Append(*aBrowserUrl);
if (task.Exists())
{
LOG_WRITE(_L("task.Exists() TRUE"));
task.SendMessage(TUid::Uid(0), *param8); // UID is not used
session.Close();
if (param8)
{
delete[] param8;
param8 = NULL;
}
}
else
{
RApaLsSession apaLsSession;
test = apaLsSession.Connect();
if (test != KErrNone)
{
apaLsSession.Close();
session.Close();
if (param8)
{
delete[] param8;
param8 = NULL;
}
return;
}
TThreadId thread;
HBufC* tempUrl = NULL;
TInt err1 = Converter::Convert8To16(*param8, tempUrl);
if (!err1)
{
test = apaLsSession.StartDocument(*tempUrl, id, thread);
if (test != KErrNone)
{
//do something
apaLsSession.Close();
session.Close();
if (param8)
{
delete[] param8;
param8 = NULL;
}
//CleanupStack::PopAndDestroy(param8);
return;
}
else
{
if (param8)
{
delete[] param8;
param8 = NULL;
}
LOG_WRITE(_L("No Browser ERROR"));
}
}
else
{
LOG_WRITE(_L("ERROR"));
}
}
}
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| launching wap browser with URL | mtg101 | General Symbian C++ | 28 | 2008-07-01 17:01 |
| how to launch web browser in 7650 and open a given url | zhxk | General Symbian C++ | 1 | 2003-12-01 15:17 |
| Mobile Browser rendering of local files vs URL files with Wap Gateway Simulator | SauliK58 | General Browsing | 2 | 2003-05-26 09:32 |
| ! Solution found for Opening WAP Browser with a url | jpankaj | Symbian Networking & Messaging | 2 | 2002-11-27 11:18 |
| How to open a url (WAP)from an application | engrsanjiv | General Symbian C++ | 0 | 2002-08-19 13:08 |