Launching the web browser on 3rd Edition to open a specified URL

http://wiki.forum.nokia.com/index.php/TSS000340_-_Launching_the_Web_browser_on_S60_3rd_Edition_to_open_a_specified_URL

 

Overview

Launching the Web browser on S60 3rd Edition to open a specified URL

Description

In order to launch the Web browser on S60 3rd Edition and have it automatically open a specified URL, the application must have the SWEvent capability. Note that the UID of the OSS browser in S60 3rd Edition is 0x1020724D and from S60 3rd Edition, FP1 onwards 0x10008D39.

Reference code:
RApaLsSession apaLsSession;
const TUid KOSSBrowserUidValue = {0x10008D39}; // 0x1020724D for S60 3rd Ed
HBufC* param = HBufC::NewLC(64);
param->Des().Copy(_L("4 http://www.yahoo.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
    {
    if(!apaLsSession.Handle())
      {
      User::LeaveIfError(apaLsSession.Connect());
      }
    TThreadId thread;
    User::LeaveIfError(apaLsSession.StartDocument(*param, KOSSBrowserUidValue, thread));
    apaLsSession.Close();   
    }
CleanupStack::PopAndDestroy(param);
Note: If the browser is currently in the process of loading an URL and an external application tries to open another one, the error "Unable to retrieve" is shown and the new URL is not loaded.
See also topic TSS000551 - Different browser UIDs in S60 3rd Edition and S60 3rd Edition, FP1.

Here is some additional information about the parameters that are passed as command line arguments when launching the OSS Browser:

1. Start/Continue the browser and nothing is specified (the default case)
=> Parameter = <Any text>

2. Start/Continue the browser specifying a Bookmark
=> Parameter = “1”+”<Space>“+”<Uid of the Bookmark>”

3. Start/Continue the browser specifying a Saved deck
=> Parameter = “2”+” <Space>“+”<Uid of the Saved deck>”

4. Start/Continue the browser specifying a URL
=> Parameter = “4”+” <Space>“+”<Url>”

5. Start/Continue the browser specifying a URL and an Access Point
=> Parameter = “4”+”<Space>“+”<Url>”+”<Space>“+”<Uid of Ap>”

6. Start/Continue the browser with the start page. (Used when starting the browser with a long press of “0” in the Idle state of the phone.
=> Parameter = “5”

7. Start/Continue the browser specifying a Bookmark folder
=> Parameter = “6”+” <Space>“+”<Uid of the Folder>”

Browser Launcher API

The SDK API Plugin package for S60 3rd Edition SDKs includes the Browser Launcher API.

CBrowserLauncher

class will automatically determine which browser to launch.

Parameters passed to this API are in the same format as above:

 

<nowiki>
&nbsp;&nbsp;CBrowserLauncher* launcher = CBrowserLauncher::NewLC();
&nbsp;&nbsp;launcher->LaunchBrowserEmbeddedL(_L("4 http://www.nokia.com"));
&nbsp;&nbsp;CleanupStack::PopAndDestroy(launcher);
</nowiki>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值