© 2009 OMTP Ltd. All rights reserved. OMTP and OMTP BONDI are registered trademarks of OMTP Ltd.
To launch applications from the Web context
AppLauncherSuccessCallback
AppLauncherManager
AppLauncherManagerObject
| Interface | Method |
|---|---|
| AppLauncherSuccessCallback | void onSuccess(StringArray obj) |
| AppLauncherManager | PendingOperation launchApplication(SuccessCallback successCallback, ErrorCallback errorCallback, DOMString appURI, StringArray params) PendingOperation getInstalledApplications(AppLauncherSuccessCallback successCallback, ErrorCallback errorCallback) DOMString getDefaultApplication(DOMString mimeType) |
| AppLauncherManagerObject |
The BONDI applauncher interface provides access to the installed applications.
It also provides access to the native applications such as messaging, telephony and newly installed
applications.
This API creates (or represents) a link between the standard URI prefix and native applications, following is a list of the minimum
supported protocols and their native applications:
- http,https: default browser installed in the device.
- tel: default telephony application
- sms: default sms composing application
- mailto: default email composing application
-file: access to any file stored in the device. The file will be opened with its default application.
also an executable would be pointed using this protocol. If a executable is pointed the application
will be launched with the possibility to pass parameter to this application.
You can launch applications using the applauncher.launchApplication method.
This API provides functionality to run the installed applications in the device. The application listed using this option are those that have been registered in the system. Not all the executables are listed using this functionality. You can get the installed applications using the applauncher.getInstalledApplications method.
This API provides functionality to get the default application for a given MIME type. The MIME types supported are those that the device has applications to manage them. You can get the default applications for a given MIME type using the applauncher.getDefaultApplication method.
This is the URI used to declare this API's feature set, for use in bondi.requestFeature. For the URL, the list of features included by the feature set is provided.
All the AppLauncher features
Includes API features:
http://bondi.omtp.org/api/applauncher.launch
http://bondi.omtp.org/api/applauncher.get
This is the list of URIs used to declare this API's features, for use in bondi.requestFeature. For each URL, the list of functions covered is provided.
When any of the features
http://bondi.omtp.org/api/applauncher.get
http://bondi.omtp.org/api/applauncher.launch
is successfully requested, the interface
AppLauncherManager
is instantiated, and the resulting object appears in the global
namespace as
Bondi.appLauncherManager.
Call to AppLauncherManager methods launchApplication
Device capabilities:
applauncher.launch
Call to AppLauncherManager methods for getting list of applications
Device capabilities:
applauncher.get
applauncher.launch
Launches an application stored in the phone terminal
Security parameters:
knownName:
Known name of application, from the list given after this
table. Empty bag if application being launched does not have a well Known
name. The Known application name is determined by the implementation
from the information provided in the API.
appParam:
Parameter to application; meaning dependent on knownName.
path:
allow or deny to launch a given application path
applauncher.get
Gets the list of installed applications or the default one for a given mime type
AppLauncherSuccessCallback
Success callback for retrieving a list of applications
[Callback=FunctionOnly, NoInterfaceObject] interface AppLauncherSuccessCallback {
void onSuccess(in StringArray obj);
};
Success callback that is used in the asynchronous operation to retrieve a list of applications.
onSuccess
The callback that is invoked when retrieving the list of applications completes successfully.
void onSuccess(in StringArray obj);
AppLauncherManager
Application management base interface
interface AppLauncherManager {
PendingOperation launchApplication(in SuccessCallback successCallback,
in ErrorCallback errorCallback,
in DOMString appURI,
[Optional] in StringArray params)
raises(SecurityError, DeviceAPIError);
PendingOperation getInstalledApplications(in AppLauncherSuccessCallback successCallback,
in ErrorCallback errorCallback)
raises(DeviceAPIError);
DOMString getDefaultApplication(in DOMString mimeType)
raises(DeviceAPIError);
};
The application manager interface offers methods concerned with retrieving and launching applications.
// Define the launchApplication success callback.
function appSuccessCallback(response) {
// Application launched successfully.
}
// Define the requestFeature success callback.
function successCallback(response) {
// Feature acquired successfully - now launch an application.
bondi.appLauncher.launchApplication(appSuccessCallback,errorCallback,"tel:+34666666666");
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error: " + response.code + ", occurred");
}
// Request the applauncher feature.
bondi.requestFeature(successCallback, errorCallback, "applauncher");
launchApplication
Launches an application addressed by an URI string.
PendingOperation launchApplication(in SuccessCallback successCallback, in ErrorCallback errorCallback, in DOMString appURI, in StringArray params);
Asynchronous method.
The following URIs are the minimal set that are supported
- http://
- https://
- tel:
- mailto:
- sms:
- file://
PERMISSION_DENIED_ERROR when access is denied by the security policy.
NOT_FOUND_ERROR if the application given to be launched is not found
INVALID_ARGUMENT_ERROR If an invalid parameter is given (Datatype Mismatch) If the URI passed as appURI is malformed (Protocol not supported or invalid URI parameters). If params are wrong (parameter is wrong for the application given in the appURI)
// Define the success callback.
function successCallback(response) {
alert("Application launches successful");
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error: " + response.code + ", occurred launching an application");
}
// launch the phone application
bondi.applauncher.launchApplication(successCallback,errorCallback,"tel:+34666666666");
// launch the browser with the http address passed as parameter
bondi.applauncher.launchApplication(successCallback,errorCallback,"http://www.huescalamagia.es");
getInstalledApplications
Returns an array of strings containing the installed applications on the device. (applications that have somehow been registered in the platform). The format of the strings returned would be one of the following two ways: - If the application is from the list of known names the application string returned will be the known name (known names were explained earlier in this document) - If the application is amongst the list of known names, but is registered in the device registry then ´file:// + application path´ string will be returned.
PendingOperation getInstalledApplications(in AppLauncherSuccessCallback successCallback, in ErrorCallback errorCallback);
Asynchronous method.
INVALID_ARGUMENT_ERROR If an invalid parameter is given (DataType mismatch)
// Define the launchApplication success callback.
function launchedCallback(response)
{
alert("Application launched successful");
}
// Define the getInstalledApplications success callback.
function successCallback(response) {
// Response is an array of application paths - let's launch the first application.
bondi.applauncher.launchApplication(launchedCallback,errorCallback,"file://"+ response[0]);
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error: " + response.code + ", occurred");
}
// Get the installed applications.
bondi.applauncher.getInstalledApplications(successCallback,errorCallback,null);
getDefaultApplication
Returns the application path URI (file://) for a given mime type.
DOMString getDefaultApplication(in DOMString mimeType);
If the default application is one of the known names, the known name will be returned
Returns null if no default application is found for the given MIME Type
INVALID_ARGUMENT_ERROR if an invalid MIME type is given. The supported MIME types are the same as the terminal has registered.
// Define the success callback.
function successCallback(response) {
alert("Application launches successful");
}
// Define the error callback.
function errorCallback(response) {
alert( "The following error: " + response.code + ", occurred launching an application");
}
// Get the default application for the text/plain mime type.
var app = bondi.applauncher.getDefaultApplication("text/plain");
// Launch the application.
bondi.applauncher.launchApplication(successCallback,errorCallback,app,"/text.txt", null);
AppLauncherManagerObject
Specifies what is instantiated at feature request
interface AppLauncherManagerObject {
readonly attribute AppLauncherManager appLauncherManager;
};
Bondi implements AppLauncherManagerObject;