int BrowserLaunch(char *url);

 

Opens the specified URL in the appropriate external application.

 

Return Value

 

Returns a non-zero value if the call was successful.

 

Parameters

 

url

Specifies the URL to open.  URL must be well-formed and may require encoding.

 

External Application

Example URL

Supported Devices

Mobile Safari

http://www.dragonfiresdk.com

All

Phone Dialer

tel://5555555555

facetime://5555555555

iPhone Only

SMS Messenger

sms:5555555555

iPhone Only

Maps

http://maps.google.com/maps?q=Dallas,TX

maps:q=Dallas,TX

All

iTunes

http://itunes.apple.com/us/app/ditto/id363392316?mt=8&ls=1

All

Mail

mailto:support@dragonfiresdk.com?subject=Ignore

All

YouTube

http://www.youtube.com/watch?v=uDueddAn6zM

All

 

NOTE: Attempting to launch Phone Dialer or SMS Messenger on devices that do not support those features will have no effect.  The Windows Simulator does not support all URI schemes.

 

Remarks

 

BrowserLaunch() will terminate your application on devices that do not support multitasking.  On devices that support multitasking, your application will enter the background.

 

Availability

 

Available in DragonFireSDK 1.4 and later.

 

Example

 

The example below demonstrates some of the various ways BrowserLaunch() may be used.

 

#include "DragonFireSDK.h"

 

int AppStoreButton;

int SMSButton;

int DialerButton;

int MapsButton;

int MailButton;

int WebButton;

int VideoButton;

 

float Latitude;

float Longitude;

 

int OnButton(int id)

{

 

  char URL[300];

 

  switch (id) {

      case 1:

          // Go to the App Store

           sprintf(URL, "http://itunes.apple.com/us/app/ditto/id363392316?mt=8&ls=1");

          break;

      case 2:

          // Open the SMS application

           sprintf(URL, "sms:5555555555");

          break;

      case 3:

          // Dial a phone number

           sprintf(URL, "tel://5555555555");

          break;

      case 4:

          // Open the Maps Application

           LocationGet(Latitude, Longitude);

           sprintf(URL, "http://maps.google.com/maps?q=%f,%f", Latitude, Longitude);

          break;

      case 5:

          // Open the Mail Application

           sprintf(URL, "mailto:support@dragonfiresdk.com?subject=Ignore");

          break;

      case 6:

          // Open Mobile Safari

           sprintf(URL, "http://www.dragonfiresdk.com");

          break;

      case 7:

          // open YouTube

           sprintf(URL, "http://www.youtube.com/watch?v=uDueddAn6zM");

          break;

      default:

          break;

   }

 

   BrowserLaunch(URL);

  return(1);

}

 

void AppMain()

{

   LocationMonitorLocation(1);

 

   AppStoreButton = ButtonAdd("Images/AppStore", 10, 80, OnButton, 1);

   SMSButton = ButtonAdd("Images/SMS", 10, 140, OnButton, 2);

   DialerButton = ButtonAdd("Images/Dialer", 10, 200, OnButton, 3);

   MapsButton = ButtonAdd("Images/Maps", 10, 260, OnButton, 4);

   MailButton = ButtonAdd("Images/Mail", 10, 320, OnButton, 5);

   WebButton = ButtonAdd("Images/Safari", 10, 380, OnButton, 6);

   VideoButton = ButtonAdd("Images/YouTube", 10, 440, OnButton, 7);

 

   AdBannerInit(0);

}

 

//===============================================

void OnTimer()

{

 

}

 

//===============================================

void AppExit()

{

 

}