Tizen Ver2.2 Application API Example 2014. 08. 18
Contents Application API Application Control Example
Application API Privilege, Functions
Application API Enables searching running applications list and executing other applic ations using the application control. To take a picture, executing the Camera application, or to listening the music, using the Music Player are the typical examples. Application control has similar role as if in Android, implicit or explicit intent accesses to other applications. Here is its privileges:
Application API getappsinfo : get applications informa tion installed on the devi ce currently.
Application API getappscontext : get currently running ap plications information
Application API getappinfo :call specific application s information.
Application API getappcontext : get current application s i nformation.
Application API launch : launch a specific applica tion. (need launch privile ge)
Application Control
Application Control There are different types of application control requests for launching other applicatio ns. The system determines which application is suitable for handling the application co ntrol request: Explicit launch Determine which application must be launched. If you specify the exact application ID, t he application ID determines which application is launched and the application perform s the operation as specified in the application control request. (showed before slide) Implicit launch You provide information to describe the request to be performed by the newly launche d application without the application ID. The system uses the information to resolve the application control, by trying to find the proper application to perform the requested a pplication control and then launching the selected application.
Application Control Following attributes are used to resolve which application is launched: Operation (Mandatory) : string that defines the action to be performed by the applicatio n control. URI : data on which the action is performed. MIME type : specific type of the URI additional data : key-value pairs providing additional information for the control request.
Application Control Operation Key Description http://tizen.org/appcontrol/operati on/view http://tizen.org/appcontrol/operati on/call - Display the requested data (show an image or text, or play music or a video). The URI scheme must co ntain the path to the requested data. These are standard operations. You can also generate custom operation. - Make a call to a specific phone number. The URI s cheme must be tel:or set to NULL. http://tizen.org/appcontrol/operati on/pick http://tizen.org/appcontrol/operati on/create_content http://tizen.org/appcontro l/data/selected http://tizen.org/appcontro l/data/selected Provide a selection window for requested items an d return the selection. The return value (the path t o the selected item) must be stored with the data key. Create content (such as a photo or video). The ret urn value (the path to the created content) must b e stored with the data key. http://tizen.org/appcontrol/operati on/dial - Show the dialer UI and dial a number using the re quested phone number. The URI scheme must be tel:or set to NULL. If the URI scheme is NULL, th e dialer UI is shown without a phone number. http://tizen.org/appcontrol/operati on/share - Share content (for example, share a picture with fri ends using SNS services). The URI scheme must co ntain the path of the data. http://tizen.org/appcontrol/operati on/multi_share http://tizen.org/appcontro l/data/path Share multiple files. Each data path must be saved as anapplicationcontroldataobject with the data key.
Application Control How to call predefined applications that are provided by Tizen platform Service Operation Scheme MIME Browsing a Web page http://tizen.org/appcontrol/ope ration/view http https - Displaying an i mage http://tizen.org/appcontrol/ope ration/view file http image/bmp image/gif https image/jpeg image/png Playing a sound file file audio/aac audio/amr audio/mp3 audio/wav Playing a video file Selecting a file http://tizen.org/appcontrol/ope ration/pick video/mp4 video/3gpp */* image/* video/* audio/*
Application Control Predefined applications can be called explicitly by specifing particular application using application ID. The list of provided application ID is here
Example Application Control Example
Example This is a application control example. (make app_control.js file in the project) operation URI MIME ApplicationControl : parameters are operatio n, URI, MIME, additional data. launchappcontrol : parameters are defined ApplicationControl, application ID (when explici t), success callback, fail callb ack, data return callback
Example Execution Result main.js result app_control.js result In here, the window will be opened which asks choosing an application bet ween Gallary and File Manager.(or there would be other applications)
Reference Hojun Jaygarl at al. Professional Tizen Application Development, 2014 Tizen Dev Guide 2.2.1 https://developer.tizen.org/ko/documentation/dev-guide/2.2.1