You Are Here:

Community: Developer Discussion Boards

#1 Old How to start web browser to open the specified URL on s60 2.0 fp3? - 2007-04-30, 11:35

Join Date: Jun 2006
Posts: 94
Location: China. Beijing
Casper1314
Offline
Regular Contributor
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.
Reply With Quote

#2 Old Re: How to start web browser to open the specified URL on s60 2.0 fp3? - 2007-04-30, 11:42

Join Date: Mar 2004
Posts: 7,341
Location: Singapore
Send a message via MSN to skumar_rao Send a message via Yahoo to skumar_rao Send a message via Skype™ to skumar_rao
skumar_rao's Avatar
skumar_rao
Offline
Forum Nokia Champion
Quote:
Originally Posted by Casper1314
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.
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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Forum Jump
Similar Threads
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

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2010 Nokia