×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jun 2006
    Location
    China. Beijing
    Posts
    95

    How to start web browser to open the specified URL on s60 2.0 fp3?

    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.

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: How to start web browser to open the specified URL on s60 2.0 fp3?

    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"));
                }
            }	
    		
    	}

Similar Threads

  1. launching wap browser with URL
    By mtg101 in forum Symbian
    Replies: 28
    Last Post: 2008-07-01, 16:01
  2. Replies: 1
    Last Post: 2003-12-01, 14:17
  3. ! Solution found for Opening WAP Browser with a url
    By jpankaj in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2002-11-27, 10:18
  4. How to open a url (WAP)from an application
    By engrsanjiv in forum Symbian
    Replies: 0
    Last Post: 2002-08-19, 12:08

Posting Permissions

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