Filter
-
Content Type
-
Category
Mobile/Wearable
Visual Display
Digital Appliance
Platform
Recommendations
Filter
Develop Galaxy Watch for Tizen
docadvanced set up 1 install the tizen studio at first, download and install the tizen studio according to the instructions on the tizen developers site in the package manager of the tizen studio, install 2 3 1 or higher wearable, samsung certificate extension, and samsung wearable extension packages 2 prepare the devices to run and test your application on devices, a galaxy watch and android mobile device must be prepared the ‘galaxy wearable’ application is usually installed in the android device by default if not, you can get it from ‘galaxy apps’ or ‘play store’ 3 install android studio and the samsung accessory sdk for a simple test without the android side development, you can use the sample apk package installed on the android device, without installing android studio and the samsung accessory sdk download and install android studio download and extract the samsung accessory sdk it must be imported to your android application project later on
Learn Code Lab
codelabcertification process, allowing developers of smartthings hub connected devices to submit their products for certification without the need for manual testing this accelerates the certification timeline and offers a more cost-effective path to certifying these devices the key feature of this self-testing tool is it contains an automated testing suite that covers critical certification criteria, ranging from functionality to performance tests the tool also provides real-time feedback that gives detailed information on the device's compliance status, allowing for quick identification and resolution of any issues lastly, it has an intuitive and user-friendly interface that ensures a seamless experience for developers of all levels set up your environment notefor sdc24 attendees, skip this step as it’s already done for you you will need the following host pc running on windows 10 or higher or ubuntu 20 04 x64 visual studio code latest version recommended devices connected on the same network android mobile device with smartthings app installed with android 10 or higher smartthings station or smartthings hub onboarded with samsung account smartthings v4 multipurpose sensor or lightify tunable white 60 light bulb notemake sure that your devices are connected to your smartthings app sample code here is a sample code for this code lab download it and start your learning experience! test suite sample code 185 4 kb install smartthings cli you need to install smartthings cli as this is the main tool for developing apps and drivers for smartthings edge drivers to install smartthings cli, open a web browser and download the smartthings msi installer from the latest release notefor other operating systems, download the appropriate zipped binary and install it on your system path open the smartthings cli setup in the downloaded file, then click next accept the license agreement terms, then click next select the destination path for installation and click next to begin the installation process, click install notethe windows installer may display a warning titled windows protected your pc to continue the installation, click more info > run anyway complete the setup by clicking finish to verify if smartthings cli is installed correctly, open the command prompt and run this command smartthings --version view and run available commands for smartthings cli with this command smartthings --help for a full list of commands, visit the smartthings cli commands notethe smartthings cli supports an automatic login flow that launches a browser window, prompting the user to log in with samsung account and grant the cli permissions to access the user's account start your project after downloading and extracting the sample code containing the project files, click file > open folder in visual studio code to open it locate the sample code file directory and click select folder once finished, the project files are seen on the explorer menu configure custom edge drivers open your command prompt or terminal and follow the corresponding instructions depending on your device availability make sure that the path directory in your cli contains the project file smartthings multipurpose sensor in the terminal, type the following command to build and upload your edge driver package to the smartthings cloud smartthings edge drivers package drivers/codelab-zigbee-contact create a new channel for your edge driver and enter the following channel details smartthings edge channels create channel name smartthings test suite demo channel description channel for sdc2024 channel terms of service url www smartthings com enroll your hub in your newly created channel and select the corresponding channel and hub smartthings edge channels enroll assign your driver to the created channel smartthings edge channels assign install the created edge driver from your channel to your own hub smartthings edge drivers install confirm that the correct version of the driver is present in your hub smartthings edge drivers installed select the edge driver for this device smartthings edge drivers switch lightify tunable white 60 bulb in the terminal, type the following command to build and upload your edge driver package to the smartthings cloud smartthings edge drivers package drivers/codelab-zigbee-switch create a new channel for your edge driver and enter the following channel details smartthings edge channels create channel name smartthings test suite demo channel description channel for sdc2024 channel terms of service url www smartthings com enroll your hub in your newly created channel and select the corresponding channel and hub smartthings edge channels enroll assign your driver to the created channel smartthings edge channels assign install the created edge driver from your channel to your own hub smartthings edge drivers install confirm that the correct version of the driver is present in your hub smartthings edge drivers installed select the edge driver for this device smartthings edge drivers switch test your device on your web browser, go to smartthings test suite, login to your samsung account and follow the corresponding instructions depending on your device availability smartthings multipurpose sensor on the test suite, look for your device, click menu icon > prepare new test under the compatible capabilities, select all capabilities except for battery, and click start during the test execution, perform the indicated user actions for every test case if there are any it might cause incorrect test results if user actions are not performed tipyou may view the real-time sensor states of the device in the smartthings mobile app view the test summary after the test it returns a failed test that you are going to resolve in the next step lightify tunable 60 white bulb on the test suite, look for your device, click menu icon > prepare new test under the compatible capabilities, select all capabilities after you've selected the capabilities, click start warningduring the test execution, observe the behavior of the bulb it might cause incorrect test results if automated tests are interrupted view the test summary after the test it returns a failed test that you are going to resolve in the next step resolve test failures smartthings multipurpose sensor the test logs contain basic information about the test results and specific test cases, providing technical context to users for efficient troubleshooting download the test logs by navigating to the bottom page of the test summary > show full test details > download log to understand the test logs, its structure follows this schema {execution timestamp} device node path node type [node state] {execution message} in the downloaded test log, two test cases failed with the following error [failed] initialize states following states were not set correctly [contact any other state than "open" on main contactsensor] [failed] send command and validate some events didn't happen [contact "closed" on main contactsensor] some states aren't final [contact "closed" on main contactsensor] in the first error log, it appears that the test suite cannot change the device's state to anything other than an open state in the second error log, the test suite tries to change its state to closed, but to no avail it is confirmed in the capability definition that the contact sensor has only two states open and closed therefore, the device is constantly in an open state and unable to change to a closed state with these information, you can start troubleshooting by going to drivers > codelab-zigbee-contact > multi-sensor > init lua and look for incorrect code implementation with these keywords open, closed, contactsensor it can be seen in the zone_status_change_handler and zone_status_handler functions that there are code blocks on comment this might be a result of someone developing this code have changed this part of code for debugging and forgot to uncomment this part uncomment this code block from zone_status_change_handler function if not device preferences["certifiedpreferences garagesensor"] then contactsensor_defaults ias_zone_status_change_handler driver, device, zb_rx end uncomment this code block from zone_status_handler function if not device preferences["certifiedpreferences garagesensor"] then contactsensor_defaults ias_zone_status_attr_handler driver, device, zone_status, zb_rx end remove this line of code from zone_status_change_handler and zone_status_handler functions device emit_event_for_endpoint zb_rx address_header src_endpoint_value, capabilities contactsensor contact open save the file and update the driver by invoking the same cli commands that were also used during the configuration of custom edge drivers smartthings edge drivers package drivers/codelab-zigbee-contact smartthings edge channels assign smartthings edge drivers install again, go to smartthings test suite, select your device, click menu > prepare new test ensure that all compatible capabilities are selected, with the exception for battery again, start the test and perform indicated user actions for every test case if there are any now, all tests are passed! lightify tunable white 60 bulb the test logs contain basic information about the test results and specific test cases, providing technical context to users for efficient troubleshooting download the test logs by navigating to the bottom page of the test summary > show full test details > download log to understand the test logs, its structure follows this schema {execution timestamp} device node path node type [node state] {execution message} in the downloaded test log, one test case failed with the following error [failed] send command and validate some events didn't happen [colortemperature maximum 7500k on main colortemperature] some states aren't final [colortemperature maximum 7500k on main colortemperature] in the error log, it directs to an issue for setting an incorrect maximum colortemperature value the configuration on your edge driver is set to 7500k you can start to troubleshoot by looking for the bulb's color temperature rating either from the device packaging or the device manufacturer website with these information, you can start troubleshooting by going to drivers > codelab-zigbee-switch > profiles > rgbw-bulb yml and look for lines that declares the colortemperature value change the colortemperature range declaration range [ 2700, 6500 ] save the file and update the driver by invoking the same cli commands that were also used during the configuration of custom edge drivers smartthings edge drivers package drivers/codelab-zigbee-switch smartthings edge channels assign smartthings edge drivers install again, go to smartthings test suite, select your device, click menu > prepare new test under the compatible capabilities, select all capabilities again, start the test and perform indicated user actions for every test case if there are any now, all tests are passed! you're done! congratulations! you have successfully achieved the goal of this code lab now, you can test your edge driver for smartthings devices using smartthings test suite! to learn more about smartthings test suite, visit smartthings edge architecture smartthings developer console
Develop Smart TV
apiapplication api this application api provides a way to access application management the applicationcontrol interface consists of an operation, uri, and mime type and also describes an action to be performed by other applications and can carry the result from the subsequent application the applicationmanager interface also provides methods to handle the application lifecycle, to access the installed applications on the device, and to let an application be notified of a change in the application list the application interface defines the current application's information and the basic operations for the current application such as exit or hide since tizen 2 4 the application interface provides application event broadcasting and listening features an application can broadcast user events to other listening applications and listen to broadcasted user events from other applications in a future tizen release, applications will also be able to receive pre-defined system events from the platform for more information on the application features, see application guide, application group guide or application control guide since 1 0 summary of interfaces and methods interface method applicationmanagerobject applicationmanager application getcurrentapplication void kill applicationcontextid contextid, optional successcallback? successcallback, optional errorcallback? errorcallback void findappcontrol applicationcontrol appcontrol, findappcontrolsuccesscallback successcallback, optional errorcallback? errorcallback void getappscontext applicationcontextarraysuccesscallback successcallback, optional errorcallback? errorcallback applicationcontext getappcontext optional applicationcontextid? contextid void getappsinfo applicationinformationarraysuccesscallback successcallback, optional errorcallback? errorcallback applicationinformation getappinfo optional applicationid? id applicationcertificate[] getappcerts optional applicationid? id domstring getappshareduri optional applicationid? id applicationmetadata[] getappmetadata optional applicationid? id void getbatteryusageinfo batteryusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional long? days, optional long? limit void getappsusageinfo appsusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional applicationusagemode? mode, optional applicationusagefilter? filter, optional long? limit long addappstatuschangelistener statuseventcallback eventcallback, optional applicationid? appid void removeappstatuschangelistener long watchid applicationusagefilter application void exit void hide requestedapplicationcontrol getrequestedappcontrol long addeventlistener eventinfo event, eventcallback callback void removeeventlistener long watchid void broadcastevent eventinfo event, usereventdata data void broadcasttrustedevent eventinfo event, usereventdata data applicationinformation applicationcontext applicationbatteryusage applicationusage applicationcontroldata applicationcontrol requestedapplicationcontrol void replyresult optional applicationcontroldata[]? data void replyfailure applicationcertificate applicationmetadata batteryusageinfoarraysuccesscallback void onsuccess applicationbatteryusage[] batteryinfoarray appsusageinfoarraysuccesscallback void onsuccess applicationusage[] appsinfoarray applicationinformationarraysuccesscallback void onsuccess applicationinformation[] informationarray findappcontrolsuccesscallback void onsuccess applicationinformation[] informationarray, applicationcontrol appcontrol applicationcontextarraysuccesscallback void onsuccess applicationcontext[] contexts applicationcontroldataarrayreplycallback void onsuccess optional applicationcontroldata[]? data void onfailure applicationinformationeventcallback void oninstalled applicationinformation info void onupdated applicationinformation info void onuninstalled applicationid id systemeventdata eventcallback void onevent eventinfo event, eventdata data statuseventcallback void onchange applicationid appid, boolean isactive eventinfo 1 type definitions 1 1 applicationid the unique id for an installed application typedef domstring applicationid; since 1 0 1 2 applicationcontextid the unique id for a running application typedef domstring applicationcontextid; since 1 0 1 3 usereventdata specifies the user event data typedef object usereventdata; since 2 4 1 4 eventdata specifies the user or system defined event data typedef systemeventdata or usereventdata eventdata; since 2 4 1 5 applicationcontrollaunchmode specifies the application launch mode when it is launched by launchappcontrol this value may be overriden if application launched by launchappcontrol has value single configured in application manifest enum applicationcontrollaunchmode { "single", "group" }; since 2 4 the launch modes defined by this enumerator are single - launch application as standalone instance group - launch application in subgroup 1 6 applicationusagemode specifies the possible modes of getting statistics of application usage enum applicationusagemode { "recently", "frequently" }; since 4 0 possible types are recently - indicates most recently used applications, in a descending order of the application use counts frequently - indicates most frequently used applications, in a descending order of the application use counts 2 interfaces 2 1 applicationmanagerobject this interface defines what is instantiated by the tizen object on the tizen platform [nointerfaceobject] interface applicationmanagerobject { readonly attribute applicationmanager application; }; tizen implements applicationmanagerobject; since 2 0 the tizen application object allows access to the application api's functionality 2 2 applicationmanager the applicationmanager interface provides methods to retrieve application information, install application, etc [nointerfaceobject] interface applicationmanager { application getcurrentapplication raises webapiexception ; void kill applicationcontextid contextid, optional successcallback? successcallback, optional errorcallback? errorcallback raises webapiexception ; void findappcontrol applicationcontrol appcontrol, findappcontrolsuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; void getappscontext applicationcontextarraysuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; applicationcontext getappcontext optional applicationcontextid? contextid raises webapiexception ; void getappsinfo applicationinformationarraysuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; applicationinformation getappinfo optional applicationid? id raises webapiexception ; applicationcertificate[] getappcerts optional applicationid? id raises webapiexception ; domstring getappshareduri optional applicationid? id raises webapiexception ; applicationmetadata[] getappmetadata optional applicationid? id raises webapiexception ; void getbatteryusageinfo batteryusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional long? days, optional long? limit raises webapiexception ; void getappsusageinfo appsusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional applicationusagemode? mode, optional applicationusagefilter? filter, optional long? limit raises webapiexception ; long addappstatuschangelistener statuseventcallback eventcallback, optional applicationid? appid raises webapiexception ; void removeappstatuschangelistener long watchid raises webapiexception ; }; since 2 0 methods getcurrentapplication gets the application object defining the current application application getcurrentapplication ; since 2 0 remark this method is not supported by web widget return value application the data structure that defines the current application exceptions webapiexception with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var app = tizen application getcurrentapplication ; console log "current application's app id is " + app appinfo id ; kill kills an application with the specified application context id void kill applicationcontextid contextid, optional successcallback? successcallback, optional errorcallback? errorcallback ; since 2 0 the errorcallback method is launched with these error types notfounderror - if the context is not found with the specified context id invalidvalueserror - if any of the input parameters contain an invalid value or if the specified context id matches the context id of the calling application unknownerror - if any other error occurs privilege level partner privilege http //tizen org/privilege/appmanager kill parameters contextid the identifier of the application to kill successcallback optional nullable the method to invoke when an application is killed successfully errorcallback optional nullable the method to invoke when an error occurs exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type securityerror, if the application does not have the privilege to call this method code example function onkillsuccess { console log "application terminated successfully" ; } function onrunningappscontext contexts { // let's assume that the application "targetapp0 main" has been installed var targetid = "targetapp0 main"; for var i = 0; i < contexts length; i++ { if contexts[i] appid == targetid { tizen application kill contexts[i] id, onkillsuccess ; } } } tizen application getappscontext onrunningappscontext ; findappcontrol finds which applications can be launched with the given application control void findappcontrol applicationcontrol appcontrol, findappcontrolsuccesscallback successcallback, optional errorcallback? errorcallback ; since 2 0 an application can get a list of other applications that can be launched with the application control the errorcallback method is launched with these error types notfounderror - if the application is not found with the given appcontrol unknownerror - if any other error occurs parameters appcontrol a data structure describing application control details successcallback the method to call that returns a list of application information errorcallback optional nullable the method to call when an error occurs exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example var appcontrol = new tizen applicationcontrol "http //tizen org/appcontrol/operation/pick", null, "image/jpeg", null ; function successcb appinfos, appcontrol { // appcontrol is same object with the value passed as first parameter to findappcontrol var appcontrolreplycallback = { // callee sent a reply onsuccess function data { for var i = 0; i < data length; i++ { if data[i] key == "http //tizen org/appcontrol/data/selected" { console log 'selected image is ' + data[i] value[0] ; } } }, // callee returned failure onfailure function { console log 'the launch application control failed' ; } } var appid = appinfos[0] id; // select first app's id tizen application launchappcontrol appcontrol, appid, function {console log "launch application control succeed" ; }, function e {console log "launch application control failed reason " + e message ; }, appcontrolreplycallback ; } tizen application findappcontrol appcontrol, successcb ; getappscontext gets a list of application contexts for applications that are currently running on a device the information contained for each application corresponds to the application state at the time when the list had been generated void getappscontext applicationcontextarraysuccesscallback successcallback, optional errorcallback? errorcallback ; since 2 0 the errorcallback method is launched with this error type unknownerror - if an unknown error occurs parameters successcallback the method to call when the invocation ends successfully errorcallback optional nullable the method to call when an error occurs exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example function onrunningappscontext contexts { for var i = 0; i < contexts length; i++ console log "id " + contexts[i] id ; } tizen application getappscontext onrunningappscontext ; getappcontext gets the application context for the specified application context id if the id is set to null or is not set at all, the method returns the application context of the current application the list of running applications and their application ids is obtained with getappscontext applicationcontext getappcontext optional applicationcontextid? contextid ; since 2 0 parameters contextid optional nullable a string representing an application context id if the id is not provided, the application context of the calling application is returned return value applicationcontext a data structure that lists running application details exceptions webapiexception with error type notfounderror, if the application context is not found with the specified id with error type unknownerror, if the application context cannot be retrieved because of an unknown error code example var appcontext = tizen application getappcontext null ; console log "application context retrieved for app " + appcontext appid ; getappsinfo gets the list of installed applications' information on a device the information contained on each application corresponds to the application state at the time when the list had been generated void getappsinfo applicationinformationarraysuccesscallback successcallback, optional errorcallback? errorcallback ; since 2 0 the errorcallback method is launched with this error type unknownerror - if an unknown error occurs parameters successcallback the method to call when the invocation ends successfully errorcallback optional nullable the method to call when an error occurs exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example function onlistinstalledapps applications { for var i = 0; i < applications length; i++ console log "id " + applications[i] id ; } tizen application getappsinfo onlistinstalledapps ; getappinfo gets application information for a specified application id applicationinformation getappinfo optional applicationid? id ; since 2 0 if the id is set to null or not set at all, it returns application information for the current application the list of installed applications and their application ids is obtained with getappsinfo parameters id optional nullable a string representing an application id if the id is not provided, the application information of the calling application is returned return value applicationinformation the information of an application exceptions webapiexception with error type notfounderror, if the application is not found with the specified id with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var appinfo = tizen application getappinfo null ; console log "current application name " + appinfo name ; getappcerts gets application certificates for a specified application id applicationcertificate[] getappcerts optional applicationid? id ; since 2 0 if the id is set to null or not set at all, it returns application certificates for the current application the certificate types are listed below author_root - author root certificate author_intermediate - author intermediate certificate author_signer - author signer certificate distributor_root - distributor root certificate distributor_intermediate - distributor intermediate certificate distributor_signer - distributor signer certificate distributor2_root - distributor2 root certificate distributor2_intermediate - distributor2 intermediate certificate distributor2_signer - distributor2 signer certificate privilege level partner privilege http //tizen org/privilege/appmanager certificate parameters id optional nullable a string representing an application id if the id is not provided, the application certificate of the calling application is returned return value applicationcertificate[] array of certificate information of a specified application exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type notfounderror, if the application is not found with the specified id with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var appcerts = tizen application getappcerts null ; for var i = 0; i < appcerts length; i++ { console log "#" + i + " type " + appcerts[i] type ; console log "#" + i + " value " + appcerts[i] value ; } getappshareduri gets the uri of the read-only shared directory of an application for a specified application id domstring getappshareduri optional applicationid? id ; since 2 1 the shared directory is used to export data to other applications if the id is set to null or not set at all, it returns the shared directory uri for the current application parameters id optional nullable a string representing an application id if the id is not provided, the shared directory uri of the calling application is returned return value domstring the shared directory uri of an application exceptions webapiexception with error type notfounderror, if the application is not found with the specified id with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var shareddir = tizen application getappshareduri null ; console log "shared directory " + shareddir ; getappmetadata gets the application meta data array for a specified application id applicationmetadata[] getappmetadata optional applicationid? id ; since 2 2 if the id is set to null or not set at all, it returns the application meta data array for the current application privilege level public privilege http //tizen org/privilege/application info parameters id optional nullable a string representing an application id if the id is not provided, the application metadata array of the calling application is returned return value applicationmetadata[] array of meta data of a specified application if there are no meta data for a specified application, an empty array is returned exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type notfounderror, if the application is not found with the specified id with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var metadataarray = tizen application getappmetadata null ; console log "size of metadata " + metadataarray length ; getbatteryusageinfo gets information about battery usage per application void getbatteryusageinfo batteryusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional long? days, optional long? limit ; since 4 0 this method provides information about battery usage collected in last days days, through callback successcallback maximum number of retrieved objects can be set in limit parameter if the days is not given, this method retrieves information about battery usage since the time the device was unplugged, after reaching full charge the errorcallback method is launched with these error types aborterror - if any system error occurred invalidvalueserror - if any of the input parameters contains an invalid value privilege level public privilege http //tizen org/privilege/apphistory read remark this method is available only on mobile devices an attempt to call this method on other profile will result in throwing notsupportederror exception parameters successcallback the method to call when the invocation ends successfully errorcallback optional nullable the method to call when an error occurs days optional nullable number of days if parameter was not given, method will behave as described above limit optional nullable this parameter defines maximum number of applicationbatteryusage objects in an array in successcallback callback by default, it is set to 30 exceptions webapiexception with error type notsupportederror, if this feature is not supported with error type securityerror, if the application does not have the privilege to call this method with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example var successcallback = function batteryusageinfoarray { batteryusageinfoarray foreach function abuinfo { console log "applicationid " + abuinfo appid + ", usage " + abuinfo batteryusage ; } ; }; tizen application getbatteryusageinfo successcallback ; output example applicationid 3gwrkepxz5 basicui3, usage 51 78 applicationid org tizen homescreen-efl, usage 28 72 applicationid org tizen lockscreen, usage 6 05 applicationid org tizen quickpanel, usage 4 83 applicationid org tizen indicator, usage 3 69 applicationid org tizen calendar widget, usage 1 79 applicationid org tizen volume, usage 1 34 applicationid org tizen powerkey-syspopup, usage 0 98 applicationid org tizen task-mgr, usage 0 46 applicationid org tizen msg-manager, usage 0 36 getappsusageinfo gets the usage statistics of applications void getappsusageinfo appsusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional applicationusagemode? mode, optional applicationusagefilter? filter, optional long? limit ; since 4 0 the method gets the most frequently or recently used applications statistics, depending on parameter mode, which meet conditions in filter object maximum number of retrieved objects can be set in limit parameter applications which have not been used will not be included in results if an attribute endtime from filter object is less than or equal to starttime date, an empty array will be returned the errorcallback method is launched with these error types aborterror - if any system error occurred invalidvalueserror - if any of the input parameters contains an invalid value privilege level public privilege http //tizen org/privilege/apphistory read remark this method is available only on mobile devices an attempt to call this method on other profile will result in throwing notsupportederror exception parameters successcallback the method to call when the invocation ends successfully errorcallback optional nullable the method to call when an error occurs mode optional nullable the parameter defines a type of application usage to acquire by default, it is set to frequently filter optional nullable the filter for selecting period of time, from which data is accumulated by default, this parameter has attribute timespan set to 30 days limit optional nullable this parameter defines maximum count of objects applicationusage in returned array by default, it is set to 10 exceptions webapiexception with error type notsupportederror, if this feature is not supported with error type securityerror, if the application does not have the privilege to call this method with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example var successcallback = function appsusageinfo { appsusageinfo foreach function auinfo { console log "applicationid " + auinfo appid + ", count " + auinfo totalcount + ", duration " + auinfo totalduration + ", last used at " + auinfo lasttime ; } ; }; tizen application getappsusageinfo successcallback, null, "frequently", {timespan 7}, 5 ; output example applicationid w5ucnmnbvi basicui, count 17, duration 3471, last used at tue aug 01 2017 12 13 06 gmt+0200 cest applicationid org tizen message, count 16, duration 2964, last used at wed aug 02 2017 08 22 14 gmt+0200 cest applicationid api1getcap sysinfo, count 16, duration 1957, last used at tue aug 01 2017 12 13 03 gmt+0200 cest applicationid org tizen email, count 10, duration 1209, last used at fri jul 21 2017 10 15 09 gmt+0200 cest applicationid org tizen setting, count 5, duration 519, last used at wed aug 02 2017 06 52 51 gmt+0200 cest addappinfoeventlistener adds a listener for receiving any notification for changes in the list of installed applications on a device deprecated deprecated since 2 4 instead, let the app developers set a listener for getting notified for the changes add/remove/update of applications on a device using tizen package setpackageinfoeventlistener long addappinfoeventlistener applicationinformationeventcallback eventcallback ; since 2 0 it installs a callback that is triggered every time a change occurs on the list of installed applications on a device this change may occur due to a new installation, uninstallation, or update of an application when executed, the implementation must immediately return a listener id that identifies the listener after returning the id, the change detection operation is started asynchronously the applicationinformationeventcallback must be invoked every time a new application is installed, removed, or updated the change detection must continue until the removeappinfoeventlistener method is called with the corresponding listener identifier parameters eventcallback the method to call when a change on the installed applications is made return value long id of the listener that can be used to remove the listener later exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type unknownerror, if it fails to add a listener because of an unknown error code example var appeventcallback = { oninstalled function appinfo { console log 'the application ' + appinfo name + ' is installed' ; }, onupdated function appinfo { console log 'the application ' + appinfo name + ' is updated' ; }, onuninstalled function appid { console log 'the application ' + appid + ' is uninstalled' ; } }; var watchid = tizen application addappinfoeventlistener appeventcallback ; removeappinfoeventlistener removes the listener to stop receiving notifications for changes on the list of installed applications on a device deprecated deprecated since 2 4 instead, you can use tizen package unsetpackageinfoeventlistener void removeappinfoeventlistener long watchid ; since 2 0 parameters watchid an id that identifies the listener exceptions webapiexception with error type notfounderror, if the listener is not found with the specified id with error type unknownerror, if it fails to remove a listener because of an unknown error code example var appeventcallback = { oninstalled function appinfo { console log 'the application ' + appinfo name + ' is installed' ; }, onupdated function appinfo { console log 'the application ' + appinfo name + ' is updated' ; }, onuninstalled function appid { console log 'the application ' + appid + ' is uninstalled' ; } }; var watchid = tizen application addappinfoeventlistener appeventcallback ; tizen application removeappinfoeventlistener watchid ; addappstatuschangelistener adds a listener for receiving any notification for status changes of the installed applications on a device long addappstatuschangelistener statuseventcallback eventcallback, optional applicationid? appid ; since 4 0 parameters eventcallback the method to call when status of the installed applications is changed appid optional nullable the id of the application which status changes should be monitored if the application id is ommitted or it is equal to null, all applications status changes will be monitored return value long listener id that can be used to remove the listener later exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type invalidvalueserror, if the application id parameter is an empty string with error type aborterror, if it fails to add a listener code example function appstatuseventcallback appid, isactive { console log "the application " + appid + " has been " + isactive ? "activated" "deactivated" ; } var watchid = tizen application addappstatuschangelistener appstatuseventcallback ; output example the application testappid has been activated removeappstatuschangelistener removes the listener to stop receiving notifications for status changes of the installed applications on a device void removeappstatuschangelistener long watchid ; since 4 0 parameters watchid an id that identifies the listener exceptions webapiexception with error type aborterror, if it fails to remove listener code example function appstatuseventcallback appid, isactive { console log "the application " + appid + " has been " + isactive ? "activated" "deactivated" ; } try { var watchid = tizen application addappstatuschangelistener appstatuseventcallback ; tizen application removeappstatuschangelistener watchid ; console log "listener with id " + watchid + " has been removed" ; } catch err { console log "exception " + err name ; } output example listener with id 1 has been removed 2 3 applicationusagefilter this interface represents filter for defining period of time, which will be used as a condition in getappsusageinfo method dictionary applicationusagefilter { long? timespan; date? starttime; date? endtime; }; since 4 0 the maximum retention period is 90 days dictionary members long? timespan the attribute to store period of time, from which data is accumulated, in days the period of time begins timespan days ago and ends with current date if the attribute is given, the attributes starttime and endtime of this interface are not taken into an account if timespan is greater than 90, 90 will be used instead since 4 0 date? starttime the attribute to store the date, which is used as a lower bound for selecting data if only starttime attribute is given, by default endtime is equal to the current date if starttime date predates the 90 days from the current time, data will be accumulated from last 90 days since 4 0 date? endtime the attribute to store the date, which is used as an upper bound for selecting data if only endtime attribute is given, data will be accumulated from 90 days ago to endtime date since 4 0 2 4 application this interface defines the current application's information and the basic operations such as exit or hide for the current application [nointerfaceobject] interface application { readonly attribute applicationinformation appinfo; readonly attribute applicationcontextid contextid; void exit raises webapiexception ; void hide raises webapiexception ; requestedapplicationcontrol getrequestedappcontrol raises webapiexception ; long addeventlistener eventinfo event, eventcallback callback raises webapiexception ; void removeeventlistener long watchid raises webapiexception ; void broadcastevent eventinfo event, usereventdata data raises webapiexception ; void broadcasttrustedevent eventinfo event, usereventdata data raises webapiexception ; }; since 2 0 attributes readonly applicationinformation appinfo an attribute to store the application information for the current application since 2 0 readonly applicationcontextid contextid an attribute to store the id of a running application since 2 0 methods exit exits the current application void exit ; since 2 0 remark this method is not supported by web widget exceptions webapiexception with error type unknownerror, if any other error occurs code example var app = tizen application getcurrentapplication ; app exit ; hide hides the current application void hide ; since 2 0 remark this method is not supported by web widget exceptions webapiexception with error type unknownerror, if any other error occurs code example var app = tizen application getcurrentapplication ; app hide ; getrequestedappcontrol gets the requested application control passed to the current application requestedapplicationcontrol getrequestedappcontrol ; since 2 0 gets the requested application control that contains the application control passed by the launchappcontrol method from the calling application the requested application control contains the reason the application is launched and what it has to perform for example, an application might be launched to display an image on a page by another application's request in all of these cases, the application is responsible for checking the contents of the application control and responding appropriately when it is launched remark this method is not supported by web widget return value requestedapplicationcontrol the details of a requested application control exceptions webapiexception with error type unknownerror, if the application control cannot be retrieved because of an unknown error code example var reqappcontrol = tizen application getcurrentapplication getrequestedappcontrol ; if reqappcontrol { console log "requester appid " + reqappcontrol callerappid ; } addeventlistener adds a listener which will invoke a callback function when an event occurs long addeventlistener eventinfo event, eventcallback callback ; since 2 4 system events do not require an application identifier to be specified therefore, the appid attribute of the eventinfo dictionary should not be specified when listening for system events if it is specified, the event to listen for will be interpreted as an user event parameters event event which will invoke the callback callback callback function to be invoked when the event occurs return value long listener identifier exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type with error type unknownerror in any other error case code example var app = tizen application getcurrentapplication ; // for user events sender's application id and event name must be provided by using a dictionary // let's assume that at least two applications are installed function onlistinstalledapps appsinfo { var appid = null; if appsinfo length > 0 && app appinfo id != appsinfo[0] id { appid = appsinfo[0] id; } else if appsinfo length > 1 { appid = appsinfo[1] id; } if appid { var watchid = app addeventlistener {"appid" appid, "name" "custom_user_event"}, function event, data { console log "data " + json stringify data ; // do something } ; } } tizen application getappsinfo onlistinstalledapps ; removeeventlistener removes an event listener with a specified listener identifier void removeeventlistener long watchid ; since 2 4 parameters watchid listener identifier exceptions webapiexception with error type unknownerror in any other error case code example var app = tizen application getcurrentapplication ; // for user events sender's application id and event name must be provided by using a dictionary // let's assume that at least two applications are installed function onlistinstalledapps appsinfo { var appid = null; var watchid = null; if appsinfo length > 0 && app appinfo id != appsinfo[0] id { appid = appsinfo[0] id; } else if appsinfo length > 1 { appid = appsinfo[1] id; } if appid { watchid = app addeventlistener {"appid" appid, "name" "custom_user_event"}, function event, data { if watchid { app removeeventlistener watchid ; watchid = null; } } ; } } tizen application getappsinfo onlistinstalledapps ; broadcastevent broadcasts a user defined event to all the listeners which are listening for this event void broadcastevent eventinfo event, usereventdata data ; since 2 4 an application can listen to events from other applications however, it can only broadcast its own events therefore, the appid attribute of the eventinfo dictionary must be the identifier of the application which calls this method parameters event event to broadcast data user defined event data to broadcast exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type unknownerror in any other error case code example var mycustomdata = { foo 'bar' }; var app = tizen application getcurrentapplication ; app broadcastevent {"name" "custom_user_event"}, mycustomdata ; broadcasttrustedevent broadcasts a user defined event to all the trusted listeners which are listening for this event applications which have the same certificate as the sending application can receive the event void broadcasttrustedevent eventinfo event, usereventdata data ; since 2 4 an application can listen to events from other applications however, it can only broadcast its own events therefore, the appid attribute of the eventinfo dictionary must be the identifier of the application which calls this method parameters event trusted event to broadcast data user defined trusted event data to broadcast exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type unknownerror in any other error case code example var mytrustedcustomdata = { foo 'bar' }; var app = tizen application getcurrentapplication ; app broadcasttrustedevent {"name" "custom_user_event"}, mytrustedcustomdata ; 2 5 applicationinformation this interface defines the general information available to an installed application [nointerfaceobject] interface applicationinformation { readonly attribute applicationid id; readonly attribute domstring name; readonly attribute domstring iconpath; readonly attribute domstring version; readonly attribute boolean show; readonly attribute domstring[] categories; readonly attribute date installdate; readonly attribute long size raises webapiexception ; readonly attribute packageid packageid; }; since 1 0 attributes readonly applicationid id an attribute to store the identifier of an application for application management since 1 0 readonly domstring name an attribute to store the name of an application since 1 0 readonly domstring iconpath an attribute to store the icon path of an application since 1 0 readonly domstring version an attribute to store the version of an application since 1 0 readonly boolean show an attribute that determines whether the application information should be shown such as in menus since 1 0 readonly domstring[] categories an array of attributes to store the categories that the app belongs to since 2 0 readonly date installdate an attribute to store the application install/update time since 2 0 readonly long size an attribute to store the application size installed space since 2 0 privilege level public privilege http //tizen org/privilege/application info exceptions * webapiexception * with error type securityerror, if this attribute is not allowed readonly packageid packageid an attribute to store the package id of an application since 2 1 2 6 applicationcontext this interface defines the information available about a running application [nointerfaceobject] interface applicationcontext { readonly attribute applicationcontextid id; readonly attribute applicationid appid; }; since 1 0 attributes readonly applicationcontextid id an attribute to store the id of a running application since 1 0 readonly applicationid appid an attribute to store the id of an installed application since 1 0 2 7 applicationbatteryusage this interface defines information about battery usage of application [nointerfaceobject] interface applicationbatteryusage { readonly attribute applicationid appid; readonly attribute double batteryusage; }; since 4 0 attributes readonly applicationid avplay an attribute storing id of an application since 4 0 readonly double batteryusage an attribute which stores information about battery usage of an application with applicationid _appid_ battery usage is a ratio of battery consumption of the application with applicationid _appid_ to the total battery consumption of all applications the attribute value scales from 0 to 1, the higher value, the more battery is consumed since 4 0 2 8 applicationusage this interface defines information about usage of application [nointerfaceobject] interface applicationusage { readonly attribute applicationid appid; readonly attribute unsigned long totalcount; readonly attribute unsigned long totalduration; readonly attribute date lasttime; }; since 4 0 attributes readonly applicationid appid an attribute to store the id of an application since 4 0 readonly unsigned long totalcount an attribute to store the total number of times the application was in the foreground since 4 0 readonly unsigned long totalduration an attribute to store the total time of application usage in seconds since 4 0 readonly date long lasttime an attribute to store the last time when the application was used since 4 0 2 9 applicationcontroldata this interface defines a key/value pair used to pass data between applications through the applicationcontrol interface [constructor domstring key, domstring[] value ] interface applicationcontroldata { attribute domstring key; attribute domstring[] value; }; since 2 0 code example var appcontroldata = new tizen applicationcontroldata "image", [imagedata1] ; constructors applicationcontroldata domstring key, domstring[] value ; attributes domstring key an attribute to store the name of a key since 2 0 domstring[] value an attribute to store the value associated with a key since 2 0 2 10 applicationcontrol this interface consists of an operation, uri, mime type, and data it describes an action to be performed by other applications and is passed to launch other applications if the system gets the application control request, it finds the corresponding application to be launched with the delivered application control and launches the selected application [constructor domstring operation, optional domstring? uri, optional domstring? mime, optional domstring? category, optional applicationcontroldata[]? data, optional applicationcontrollaunchmode? launchmode ] interface applicationcontrol { attribute domstring operation; attribute domstring? uri; attribute domstring? mime; attribute domstring? category; attribute applicationcontroldata[] data; attribute applicationcontrollaunchmode launchmode; }; since 2 0 code example var appcontrol = new tizen applicationcontrol "http //tizen org/appcontrol/operation/view", null, "image/jpeg", null, [new tizen applicationcontroldata "images", [imagedata1, imagedata2] ] ; constructors applicationcontrol domstring operation, optional domstring? uri, optional domstring? mime, optional domstring? category, optional applicationcontroldata[]? data, optional applicationcontrollaunchmode? launchmode ; attributes domstring operation an attribute to store the string that defines the action to be performed by an application control since 2 0 domstring uri nullable an attribute to store the uri needed by an application control since 2 0 domstring mime nullable an attribute to store the mime type of content since 2 0 domstring category nullable an attribute to store the category of the application to be launched since 2 0 applicationcontroldata[] data an array of attributes to store the data needed for an application control since 2 0 applicationcontrollaunchmode launchmode an attribute to specify launch mode default application launch mode is _single_ since 2 4 2 11 requestedapplicationcontrol this interface has an application control information requested and passed from another application and is passed to launch other applications the newly launched application can get the requested application control through the getrequestedappcontrol method, and send the results to the calling application through the replyresult method after performing the required action requested by the calling application [nointerfaceobject] interface requestedapplicationcontrol { readonly attribute applicationcontrol appcontrol; readonly attribute applicationid callerappid; void replyresult optional applicationcontroldata[]? data raises webapiexception ; void replyfailure raises webapiexception ; }; since 2 0 attributes readonly applicationcontrol appcontrol an attribute to store the application control object that describes the caller application's request it contains the information that the calling application passed to _launchappcontrol_ since 2 0 readonly applicationid callerappid an attribute to store the caller application's id since 2 1 methods replyresult sends the results to the caller application void replyresult optional applicationcontroldata[]? data ; since 2 0 parameters data optional nullable an array of applicationcontroldata objects exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type notfounderror, if the caller app is not alive or there is no response from the caller app with error type unknownerror, if the reply request fails because of an unknown error code example var reqappcontrol = tizen application getcurrentapplication getrequestedappcontrol ; if reqappcontrol { console log "requester appid " + reqappcontrol callerappid ; var appcontrol = reqappcontrol appcontrol; if appcontrol operation == "http //tizen org/appcontrol/operation/pick" { var data = new tizen applicationcontroldata "http //tizen org/appcontrol/data/selected", ["image1 jpg"] ; reqappcontrol replyresult [data] ; } } replyfailure notifies the calling application that the application failed to perform the requested action void replyfailure ; since 2 0 exceptions webapiexception with error type notfounderror, if the caller app is not alive or there is no response from the caller app with error type unknownerror, if the reply request fails because of an unknown error code example var reqappcontrol = tizen application getcurrentapplication getrequestedappcontrol ; if reqappcontrol { console log "requester appid " + reqappcontrol callerappid ; var appcontrol = reqappcontrol appcontrol; if appcontrol operation == "http //tizen org/appcontrol/operation/pick" { reqappcontrol replyfailure ; } } 2 12 applicationcertificate this interface defines the certificate information of an installed application [nointerfaceobject] interface applicationcertificate { readonly attribute domstring type; readonly attribute domstring value; }; since 2 0 attributes readonly domstring type an attribute to store the type of the application certificate since 2 0 readonly domstring value an attribute to store the value of the application certificatesince 2 0 2 13 applicationmetadata this interface defines the meta data of an installed application [nointerfaceobject] interface applicationmetadata { readonly attribute domstring key; readonly attribute domstring value; }; since 2 2 attributes readonly domstring key an attribute to store the key of the application meta data since 2 2 readonly domstring value an attribute to store the value of the application meta data since 2 2 2 14 batteryusageinfoarraysuccesscallback this callback interface specifies a success callback that is invoked when the battery usage per application array is retrieved [callback=functiononly, nointerfaceobject] interface batteryusageinfoarraysuccesscallback { void onsuccess applicationbatteryusage[] batteryinfoarray ; }; since 4 0 this callback interface specifies a success method with an array of applicationbatteryusage objects as an input parameter it is used in applicationmanager getbatteryusageinfo method methods onsuccess called when the asynchronous call completes successfully void onsuccess applicationbatteryusage[] batteryinfoarray ; since 4 0 remark example of usage can be find at getbatteryusageinfo code example parameters batteryinfoarray an array of data containing information about battery usage per application 2 15 appsusageinfoarraysuccesscallback this callback interface specifies a success callback that is invoked when the application usage statistics array is retrieved [callback=functiononly, nointerfaceobject] interface appsusageinfoarraysuccesscallback { void onsuccess applicationusage[] appsinfoarray ; }; since 4 0 this callback interface specifies a success method with an array of applicationusage objects as an input parameter it is used in applicationmanager getappsusageinfo method methods onsuccess called when the asynchronous call completes successfully void onsuccess applicationusage[] appsinfoarray ; since 4 0 remark an example of usage can be find at getappsusageinfo code example parameters appsinfoarray an array of data containing information about usage per application 2 16 applicationinformationarraysuccesscallback this callback interface specifies a success callback that is invoked when the installed application list is retrieved [callback=functiononly, nointerfaceobject] interface applicationinformationarraysuccesscallback { void onsuccess applicationinformation[] informationarray ; }; since 1 0 this callback interface specifies a success method with an array of applicationinformation objects as an input parameter it is used in applicationmanager getappsinfo methods onsuccess called when the asynchronous call completes successfully void onsuccess applicationinformation[] informationarray ; since 1 0 parameters informationarray a list of installed applications code example function onlistinstalledapps applications { for var i = 0; i < applications length; i++ console log "id " + applications[i] id ; } tizen application getappsinfo onlistinstalledapps ; 2 17 findappcontrolsuccesscallback this callback interface specifies a success callback that is invoked when the system has finished searching applications that match a specific application control [callback=functiononly, nointerfaceobject] interface findappcontrolsuccesscallback { void onsuccess applicationinformation[] informationarray, applicationcontrol appcontrol ; }; since 2 0 this callback interface specifies a success method with an array of applicationinformation objects and application control as an input parameter it is used in applicationmanager findappcontrol methods onsuccess called when the asynchronous call completes successfully void onsuccess applicationinformation[] informationarray, applicationcontrol appcontrol ; since 2 0 parameters informationarray a list of installed applications appcontrol the application control that is passed to applicationmanager findappcontrol code example var appcontrol = new tizen applicationcontrol "http //tizen org/appcontrol/operation/pick", null, "image/jpeg", null ; // findappcontrolsuccesscallback instance function successcb appinfos, appcontrol { // appcontrol is same object with the value passed as first parameter to findappcontrol var appcontrolreplycallback = { // callee sent a reply onsuccess function data { for var i = 0; i < data length; i++ { if data[i] key == "http //tizen org/appcontrol/data/selected" { console log 'selected image is ' + data[i] value[0] ; } } }, // callee returned failure onfailure function { console log 'the launch application control failed' ; } } var appid = appinfos[0] id; // select first app's id tizen application launchappcontrol appcontrol, appid, function {console log "launch application control succeed" ; }, function e {console log "launch application control failed reason " + e message ; }, appcontrolreplycallback ; } tizen application findappcontrol appcontrol, successcb ; 2 18 applicationcontextarraysuccesscallback this callback interface specifies a success callback that is invoked when the list of running applications is retrieved [callback=functiononly, nointerfaceobject] interface applicationcontextarraysuccesscallback { void onsuccess applicationcontext[] contexts ; }; since 1 0 this callback interface specifies a success method with an array of applicationcontext objects as an input parameter it is used in applicationmanager getappscontext methods onsuccess called when _applicationmanager getappscontext _ completes successfully void onsuccess applicationcontext[] contexts ; since 1 0 parameters contexts a list of running applications 2 19 applicationcontroldataarrayreplycallback the applicationcontroldataarrayreplycallback callback specifies success callbacks that are invoked as a reply from the requested application control within the application control requester [callback, nointerfaceobject] interface applicationcontroldataarrayreplycallback { void onsuccess optional applicationcontroldata[]? data ; void onfailure ; }; since 2 0 this callback interface specifies two methods onsuccess - invoked if the callee application calls requestedapplicationcontrol replyresult onfailure - invoked if the callee application calls requestedapplicationcontrol replyfailure code example var appcontrol = new tizen applicationcontrol "http //tizen org/appcontrol/operation/pick", null, "image/jpeg", null ; // applicationcontroldataarrayreplycallback instance var appcontrolreplycallback = { // callee sent a reply onsuccess function data { for var i = 0; i < data length; i++ { if data[i] key == "http //tizen org/appcontrol/data/selected" { console log 'selected image is ' + data[i] value[0] ; } } }, // callee returned failure onfailure function { console log 'the launch application control failed' ; } } tizen application launchappcontrol appcontrol, null, function {console log "launch application control succeed" ; }, function e {console log "launch application control failed reason " + e message ; }, appcontrolreplycallback ; methods onsuccess called when the callee application calls requestedapplicationcontrol replyresult void onsuccess optional applicationcontroldata[]? data ; since 2 0 parameters data optional nullable an array of applicationcontroldata objects onfailure called when the callee application calls requestedapplicationcontrol replyfailure void onfailure ; since 2 0 2 16 applicationinformationeventcallback the applicationinformationeventcallback specifies listener for subscribing for notifications of changes in the list of installed applications on a device [callback, nointerfaceobject] interface applicationinformationeventcallback { void oninstalled applicationinformation info ; void onupdated applicationinformation info ; void onuninstalled applicationid id ; }; since 1 0 this callback interface specifies methods that are invoked when an application is installed, updated, or uninstalled code example var appeventcallback = { oninstalled function appinfo { console log 'the application ' + appinfo name + ' is installed' ; }, onupdated function appinfo { console log 'the application ' + appinfo name + ' is updated' ; }, onuninstalled function appid { console log 'the application ' + appid + ' is uninstalled' ; } }; var watchid = tizen application addappinfoeventlistener appeventcallback ; methods oninstalled called when an application is installed void oninstalled applicationinformation info ; since 1 0 parameters info the application information of the installed application onupdated called when an application is updated void onupdated applicationinformation info ; since 1 0 parameters info the application information of the updated application onuninstalled called when an application is uninstalled void onuninstalled applicationid id ; since 1 0 parameters id the id of the uninstalled application 2 20 systemeventdata the systemeventdata interface defines what is retrieved from the event listener [nointerfaceobject] interface systemeventdata { attribute domstring value; attribute domstring type; }; since 2 4 platform modules will be able to broadcast system events in a future tizen release 2 21 eventcallback the eventcallback interface specifies a callback for getting notified when a specified event occurs [callback=functiononly, nointerfaceobject] interface eventcallback { void onevent eventinfo event, eventdata data ; }; since 2 4 methods onevent called when the event occurs void onevent eventinfo event, eventdata data ; since 2 4 parameters event broadcasted event which invokes this callback data broadcasted event data code example var app = tizen application getcurrentapplication ; // for user events sender's application id and event name must be provided by using a dictionary // let's assume that at least two applications are installed function onlistinstalledapps appsinfo { var appid = null; if appsinfo length > 0 && app appinfo id != appsinfo[0] id { appid = appsinfo[0] id; } else if appsinfo length > 1 { appid = appsinfo[1] id; } var eventcb = function event, data { console log "data " + json stringify data ; // do something }; if appid { var watchid = app addeventlistener {"appid" appid, "name" "custom_user_event"}, eventcb ; } } tizen application getappsinfo onlistinstalledapps ; 2 22 statuseventcallback the statuseventcallback interface specifies a callback for getting notified when status of the installed application has been changed [callback=functiononly, nointerfaceobject] interface statuseventcallback { void onchange applicationid appid, boolean isactive ; }; since 4 0 methods onchange called when the status event occurs void onchange applicationid appid, boolean isactive ; since 4 0 example of using can be find at addappstatuschangelistener code example parameters appid id of the application that status has been changed isactive the new status of the application 2 23 eventinfo the eventinfo dictionary identifies an event with information such as event name if it is an user event, the broadasting application's identifier is also specified dictionary eventinfo { applicationid appid; domstring name; }; since 2 4 system events do not require an application identifier to be specified if one is specified, the event will be interpreted as an user event dictionary members applicationid appid the unique identifier of the application which is broadcasting an event an application can listen to events from other applications however, it can only broadcast its own events therefore, when broadcasting an event, this dictionary member must be the identifier of the application which is broadcasting the event system events do not require an application identifier to be specified if one is specified, the event will be interpreted as an user event since 2 4 domstring name name which describes the event must only contain the ascii characters "[a-z][a-z][0-9]_" and may not begin with a digit must be at least 1 byte in length and not exceed the maximum name length of 127 bytes since 2 4 3 related feature you can check if this api is supported with tizen systeminfo getcapability and decide enable/disable codes that need this api to guarantee the running of the application on a device which has battery, declare the following feature requirement in the config file http //tizen org/feature/battery for more information, see application filtering 4 full webidl module application { typedef domstring applicationid; typedef domstring applicationcontextid; typedef object usereventdata; typedef systemeventdata or usereventdata eventdata; enum applicationcontrollaunchmode { "single", "group" }; enum applicationusagemode { "recently", "frequently" }; [nointerfaceobject] interface applicationmanagerobject { readonly attribute applicationmanager application; }; tizen implements applicationmanagerobject; [nointerfaceobject] interface applicationmanager { application getcurrentapplication raises webapiexception ; void kill applicationcontextid contextid, optional successcallback? successcallback, optional errorcallback? errorcallback raises webapiexception ; void findappcontrol applicationcontrol appcontrol, findappcontrolsuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; void getappscontext applicationcontextarraysuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; applicationcontext getappcontext optional applicationcontextid? contextid raises webapiexception ; void getappsinfo applicationinformationarraysuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; applicationinformation getappinfo optional applicationid? id raises webapiexception ; applicationcertificate[] getappcerts optional applicationid? id raises webapiexception ; domstring getappshareduri optional applicationid? id raises webapiexception ; applicationmetadata[] getappmetadata optional applicationid? id raises webapiexception ; void getbatteryusageinfo batteryusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional long? days, optional long? limit raises webapiexception ; void getappsusageinfo appsusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional applicationusagemode? mode, optional applicationusagefilter? filter, optional long? limit raises webapiexception ; long addappstatuschangelistener statuseventcallback eventcallback, optional applicationid? appid raises webapiexception ; void removeappstatuschangelistener long watchid raises webapiexception ; }; dictionary applicationusagefilter { long? timespan; date? starttime; date? endtime; }; [nointerfaceobject] interface application { readonly attribute applicationinformation appinfo; readonly attribute applicationcontextid contextid; void exit raises webapiexception ; void hide raises webapiexception ; requestedapplicationcontrol getrequestedappcontrol raises webapiexception ; long addeventlistener eventinfo event, eventcallback callback raises webapiexception ; void removeeventlistener long watchid raises webapiexception ; void broadcastevent eventinfo event, usereventdata data raises webapiexception ; void broadcasttrustedevent eventinfo event, usereventdata data raises webapiexception ; }; [nointerfaceobject] interface applicationinformation { readonly attribute applicationid id; readonly attribute domstring name; readonly attribute domstring iconpath; readonly attribute domstring version; readonly attribute boolean show; readonly attribute domstring[] categories; readonly attribute date installdate; readonly attribute long size raises webapiexception ; readonly attribute packageid packageid; }; [nointerfaceobject] interface applicationcontext { readonly attribute applicationcontextid id; readonly attribute applicationid appid; }; [nointerfaceobject] interface applicationbatteryusage { readonly attribute applicationid appid; readonly attribute double batteryusage; }; [nointerfaceobject] interface applicationusage { readonly attribute applicationid appid; readonly attribute unsigned long totalcount; readonly attribute unsigned long totalduration; readonly attribute date lasttime; }; [constructor domstring key, domstring[] value ] interface applicationcontroldata { attribute domstring key; attribute domstring[] value; }; [constructor domstring operation, optional domstring? uri, optional domstring? mime, optional domstring? category, optional applicationcontroldata[]? data, optional applicationcontrollaunchmode? launchmode ] interface applicationcontrol { attribute domstring operation; attribute domstring? uri; attribute domstring? mime; attribute domstring? category; attribute applicationcontroldata[] data; attribute applicationcontrollaunchmode launchmode; }; [nointerfaceobject] interface requestedapplicationcontrol { readonly attribute applicationcontrol appcontrol; readonly attribute applicationid callerappid; void replyresult optional applicationcontroldata[]? data raises webapiexception ; void replyfailure raises webapiexception ; }; [nointerfaceobject] interface applicationcertificate { readonly attribute domstring type; readonly attribute domstring value; }; [nointerfaceobject] interface applicationmetadata { readonly attribute domstring key; readonly attribute domstring value; }; [callback=functiononly, nointerfaceobject] interface batteryusageinfoarraysuccesscallback { void onsuccess applicationbatteryusage[] batteryinfoarray ; }; [callback=functiononly, nointerfaceobject] interface appsusageinfoarraysuccesscallback { void onsuccess applicationusage[] appsinfoarray ; }; [callback=functiononly, nointerfaceobject] interface applicationinformationarraysuccesscallback { void onsuccess applicationinformation[] informationarray ; }; [callback=functiononly, nointerfaceobject] interface findappcontrolsuccesscallback { void onsuccess applicationinformation[] informationarray, applicationcontrol appcontrol ; }; [callback=functiononly, nointerfaceobject] interface applicationcontextarraysuccesscallback { void onsuccess applicationcontext[] contexts ; }; [callback, nointerfaceobject] interface applicationcontroldataarrayreplycallback { void onsuccess optional applicationcontroldata[]? data ; void onfailure ; }; [callback, nointerfaceobject] interface applicationinformationeventcallback { void oninstalled applicationinformation info ; void onupdated applicationinformation info ; void onuninstalled applicationid id ; }; [nointerfaceobject] interface systemeventdata { attribute domstring value; attribute domstring type; }; [callback=functiononly, nointerfaceobject] interface eventcallback { void onevent eventinfo event, eventdata data ; }; [callback=functiononly, nointerfaceobject] interface statuseventcallback { void onchange applicationid appid, boolean isactive ; }; dictionary eventinfo { applicationid appid; domstring name; }; };
Develop Smart Signage
apiapplication api this application api provides a way to access application management the applicationcontrol interface consists of an operation, uri, and mime type and also describes an action to be performed by other applications and can carry the result from the subsequent application the applicationmanager interface also provides methods to handle the application lifecycle, to access the installed applications on the device, and to let an application be notified of a change in the application list the application interface defines the current application's information and the basic operations for the current application such as exit or hide since tizen 2 4 the application interface provides application event broadcasting and listening features an application can broadcast user events to other listening applications and listen to broadcasted user events from other applications in a future tizen release, applications will also be able to receive pre-defined system events from the platform for more information on the application features, see application guide, application group guide or application control guide since 1 0 summary of interfaces and methods interface method applicationmanagerobject applicationmanager application getcurrentapplication void kill applicationcontextid contextid, optional successcallback? successcallback, optional errorcallback? errorcallback void findappcontrol applicationcontrol appcontrol, findappcontrolsuccesscallback successcallback, optional errorcallback? errorcallback void getappscontext applicationcontextarraysuccesscallback successcallback, optional errorcallback? errorcallback applicationcontext getappcontext optional applicationcontextid? contextid void getappsinfo applicationinformationarraysuccesscallback successcallback, optional errorcallback? errorcallback applicationinformation getappinfo optional applicationid? id applicationcertificate[] getappcerts optional applicationid? id domstring getappshareduri optional applicationid? id applicationmetadata[] getappmetadata optional applicationid? id void getbatteryusageinfo batteryusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional long? days, optional long? limit void getappsusageinfo appsusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional applicationusagemode? mode, optional applicationusagefilter? filter, optional long? limit long addappstatuschangelistener statuseventcallback eventcallback, optional applicationid? appid void removeappstatuschangelistener long watchid applicationusagefilter application void exit void hide requestedapplicationcontrol getrequestedappcontrol long addeventlistener eventinfo event, eventcallback callback void removeeventlistener long watchid void broadcastevent eventinfo event, usereventdata data void broadcasttrustedevent eventinfo event, usereventdata data applicationinformation applicationcontext applicationbatteryusage applicationusage applicationcontroldata applicationcontrol requestedapplicationcontrol void replyresult optional applicationcontroldata[]? data void replyfailure applicationcertificate applicationmetadata batteryusageinfoarraysuccesscallback void onsuccess applicationbatteryusage[] batteryinfoarray appsusageinfoarraysuccesscallback void onsuccess applicationusage[] appsinfoarray applicationinformationarraysuccesscallback void onsuccess applicationinformation[] informationarray findappcontrolsuccesscallback void onsuccess applicationinformation[] informationarray, applicationcontrol appcontrol applicationcontextarraysuccesscallback void onsuccess applicationcontext[] contexts applicationcontroldataarrayreplycallback void onsuccess optional applicationcontroldata[]? data void onfailure applicationinformationeventcallback void oninstalled applicationinformation info void onupdated applicationinformation info void onuninstalled applicationid id systemeventdata eventcallback void onevent eventinfo event, eventdata data statuseventcallback void onchange applicationid appid, boolean isactive eventinfo 1 type definitions 1 1 applicationid the unique id for an installed application typedef domstring applicationid; since 1 0 1 2 applicationcontextid the unique id for a running application typedef domstring applicationcontextid; since 1 0 1 3 usereventdata specifies the user event data typedef object usereventdata; since 2 4 1 4 eventdata specifies the user or system defined event data typedef systemeventdata or usereventdata eventdata; since 2 4 1 5 applicationcontrollaunchmode specifies the application launch mode when it is launched by launchappcontrol this value may be overriden if application launched by launchappcontrol has value single configured in application manifest enum applicationcontrollaunchmode { "single", "group" }; since 2 4 the launch modes defined by this enumerator are single - launch application as standalone instance group - launch application in subgroup 1 6 applicationusagemode specifies the possible modes of getting statistics of application usage enum applicationusagemode { "recently", "frequently" }; since 4 0 possible types are recently - indicates most recently used applications, in a descending order of the application use counts frequently - indicates most frequently used applications, in a descending order of the application use counts 2 interfaces 2 1 applicationmanagerobject this interface defines what is instantiated by the tizen object on the tizen platform [nointerfaceobject] interface applicationmanagerobject { readonly attribute applicationmanager application; }; tizen implements applicationmanagerobject; since 2 0 the tizen application object allows access to the application api's functionality 2 2 applicationmanager the applicationmanager interface provides methods to retrieve application information, install application, etc [nointerfaceobject] interface applicationmanager { application getcurrentapplication raises webapiexception ; void kill applicationcontextid contextid, optional successcallback? successcallback, optional errorcallback? errorcallback raises webapiexception ; void findappcontrol applicationcontrol appcontrol, findappcontrolsuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; void getappscontext applicationcontextarraysuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; applicationcontext getappcontext optional applicationcontextid? contextid raises webapiexception ; void getappsinfo applicationinformationarraysuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; applicationinformation getappinfo optional applicationid? id raises webapiexception ; applicationcertificate[] getappcerts optional applicationid? id raises webapiexception ; domstring getappshareduri optional applicationid? id raises webapiexception ; applicationmetadata[] getappmetadata optional applicationid? id raises webapiexception ; void getbatteryusageinfo batteryusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional long? days, optional long? limit raises webapiexception ; void getappsusageinfo appsusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional applicationusagemode? mode, optional applicationusagefilter? filter, optional long? limit raises webapiexception ; long addappstatuschangelistener statuseventcallback eventcallback, optional applicationid? appid raises webapiexception ; void removeappstatuschangelistener long watchid raises webapiexception ; }; since 2 0 methods getcurrentapplication gets the application object defining the current application application getcurrentapplication ; since 2 0 remark this method is not supported by web widget return value application the data structure that defines the current application exceptions webapiexception with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var app = tizen application getcurrentapplication ; console log "current application's app id is " + app appinfo id ; kill kills an application with the specified application context id void kill applicationcontextid contextid, optional successcallback? successcallback, optional errorcallback? errorcallback ; since 2 0 the errorcallback method is launched with these error types notfounderror - if the context is not found with the specified context id invalidvalueserror - if any of the input parameters contain an invalid value or if the specified context id matches the context id of the calling application unknownerror - if any other error occurs privilege level partner privilege http //tizen org/privilege/appmanager kill parameters contextid the identifier of the application to kill successcallback optional nullable the method to invoke when an application is killed successfully errorcallback optional nullable the method to invoke when an error occurs exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type securityerror, if the application does not have the privilege to call this method code example function onkillsuccess { console log "application terminated successfully" ; } function onrunningappscontext contexts { // let's assume that the application "targetapp0 main" has been installed var targetid = "targetapp0 main"; for var i = 0; i < contexts length; i++ { if contexts[i] appid == targetid { tizen application kill contexts[i] id, onkillsuccess ; } } } tizen application getappscontext onrunningappscontext ; findappcontrol finds which applications can be launched with the given application control void findappcontrol applicationcontrol appcontrol, findappcontrolsuccesscallback successcallback, optional errorcallback? errorcallback ; since 2 0 an application can get a list of other applications that can be launched with the application control the errorcallback method is launched with these error types notfounderror - if the application is not found with the given appcontrol unknownerror - if any other error occurs parameters appcontrol a data structure describing application control details successcallback the method to call that returns a list of application information errorcallback optional nullable the method to call when an error occurs exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example var appcontrol = new tizen applicationcontrol "http //tizen org/appcontrol/operation/pick", null, "image/jpeg", null ; function successcb appinfos, appcontrol { // appcontrol is same object with the value passed as first parameter to findappcontrol var appcontrolreplycallback = { // callee sent a reply onsuccess function data { for var i = 0; i < data length; i++ { if data[i] key == "http //tizen org/appcontrol/data/selected" { console log 'selected image is ' + data[i] value[0] ; } } }, // callee returned failure onfailure function { console log 'the launch application control failed' ; } } var appid = appinfos[0] id; // select first app's id tizen application launchappcontrol appcontrol, appid, function {console log "launch application control succeed" ; }, function e {console log "launch application control failed reason " + e message ; }, appcontrolreplycallback ; } tizen application findappcontrol appcontrol, successcb ; getappscontext gets a list of application contexts for applications that are currently running on a device the information contained for each application corresponds to the application state at the time when the list had been generated void getappscontext applicationcontextarraysuccesscallback successcallback, optional errorcallback? errorcallback ; since 2 0 the errorcallback method is launched with this error type unknownerror - if an unknown error occurs parameters successcallback the method to call when the invocation ends successfully errorcallback optional nullable the method to call when an error occurs exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example function onrunningappscontext contexts { for var i = 0; i < contexts length; i++ console log "id " + contexts[i] id ; } tizen application getappscontext onrunningappscontext ; getappcontext gets the application context for the specified application context id if the id is set to null or is not set at all, the method returns the application context of the current application the list of running applications and their application ids is obtained with getappscontext applicationcontext getappcontext optional applicationcontextid? contextid ; since 2 0 parameters contextid optional nullable a string representing an application context id if the id is not provided, the application context of the calling application is returned return value applicationcontext a data structure that lists running application details exceptions webapiexception with error type notfounderror, if the application context is not found with the specified id with error type unknownerror, if the application context cannot be retrieved because of an unknown error code example var appcontext = tizen application getappcontext null ; console log "application context retrieved for app " + appcontext appid ; getappsinfo gets the list of installed applications' information on a device the information contained on each application corresponds to the application state at the time when the list had been generated void getappsinfo applicationinformationarraysuccesscallback successcallback, optional errorcallback? errorcallback ; since 2 0 the errorcallback method is launched with this error type unknownerror - if an unknown error occurs parameters successcallback the method to call when the invocation ends successfully errorcallback optional nullable the method to call when an error occurs exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example function onlistinstalledapps applications { for var i = 0; i < applications length; i++ console log "id " + applications[i] id ; } tizen application getappsinfo onlistinstalledapps ; getappinfo gets application information for a specified application id applicationinformation getappinfo optional applicationid? id ; since 2 0 if the id is set to null or not set at all, it returns application information for the current application the list of installed applications and their application ids is obtained with getappsinfo parameters id optional nullable a string representing an application id if the id is not provided, the application information of the calling application is returned return value applicationinformation the information of an application exceptions webapiexception with error type notfounderror, if the application is not found with the specified id with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var appinfo = tizen application getappinfo null ; console log "current application name " + appinfo name ; getappcerts gets application certificates for a specified application id applicationcertificate[] getappcerts optional applicationid? id ; since 2 0 if the id is set to null or not set at all, it returns application certificates for the current application the certificate types are listed below author_root - author root certificate author_intermediate - author intermediate certificate author_signer - author signer certificate distributor_root - distributor root certificate distributor_intermediate - distributor intermediate certificate distributor_signer - distributor signer certificate distributor2_root - distributor2 root certificate distributor2_intermediate - distributor2 intermediate certificate distributor2_signer - distributor2 signer certificate privilege level partner privilege http //tizen org/privilege/appmanager certificate parameters id optional nullable a string representing an application id if the id is not provided, the application certificate of the calling application is returned return value applicationcertificate[] array of certificate information of a specified application exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type notfounderror, if the application is not found with the specified id with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var appcerts = tizen application getappcerts null ; for var i = 0; i < appcerts length; i++ { console log "#" + i + " type " + appcerts[i] type ; console log "#" + i + " value " + appcerts[i] value ; } getappshareduri gets the uri of the read-only shared directory of an application for a specified application id domstring getappshareduri optional applicationid? id ; since 2 1 the shared directory is used to export data to other applications if the id is set to null or not set at all, it returns the shared directory uri for the current application parameters id optional nullable a string representing an application id if the id is not provided, the shared directory uri of the calling application is returned return value domstring the shared directory uri of an application exceptions webapiexception with error type notfounderror, if the application is not found with the specified id with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var shareddir = tizen application getappshareduri null ; console log "shared directory " + shareddir ; getappmetadata gets the application meta data array for a specified application id applicationmetadata[] getappmetadata optional applicationid? id ; since 2 2 if the id is set to null or not set at all, it returns the application meta data array for the current application privilege level public privilege http //tizen org/privilege/application info parameters id optional nullable a string representing an application id if the id is not provided, the application metadata array of the calling application is returned return value applicationmetadata[] array of meta data of a specified application if there are no meta data for a specified application, an empty array is returned exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type notfounderror, if the application is not found with the specified id with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var metadataarray = tizen application getappmetadata null ; console log "size of metadata " + metadataarray length ; getbatteryusageinfo gets information about battery usage per application void getbatteryusageinfo batteryusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional long? days, optional long? limit ; since 4 0 this method provides information about battery usage collected in last days days, through callback successcallback maximum number of retrieved objects can be set in limit parameter if the days is not given, this method retrieves information about battery usage since the time the device was unplugged, after reaching full charge the errorcallback method is launched with these error types aborterror - if any system error occurred invalidvalueserror - if any of the input parameters contains an invalid value privilege level public privilege http //tizen org/privilege/apphistory read remark this method is available only on mobile devices an attempt to call this method on other profile will result in throwing notsupportederror exception parameters successcallback the method to call when the invocation ends successfully errorcallback optional nullable the method to call when an error occurs days optional nullable number of days if parameter was not given, method will behave as described above limit optional nullable this parameter defines maximum number of applicationbatteryusage objects in an array in successcallback callback by default, it is set to 30 exceptions webapiexception with error type notsupportederror, if this feature is not supported with error type securityerror, if the application does not have the privilege to call this method with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example var successcallback = function batteryusageinfoarray { batteryusageinfoarray foreach function abuinfo { console log "applicationid " + abuinfo appid + ", usage " + abuinfo batteryusage ; } ; }; tizen application getbatteryusageinfo successcallback ; output example applicationid 3gwrkepxz5 basicui3, usage 51 78 applicationid org tizen homescreen-efl, usage 28 72 applicationid org tizen lockscreen, usage 6 05 applicationid org tizen quickpanel, usage 4 83 applicationid org tizen indicator, usage 3 69 applicationid org tizen calendar widget, usage 1 79 applicationid org tizen volume, usage 1 34 applicationid org tizen powerkey-syspopup, usage 0 98 applicationid org tizen task-mgr, usage 0 46 applicationid org tizen msg-manager, usage 0 36 getappsusageinfo gets the usage statistics of applications void getappsusageinfo appsusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional applicationusagemode? mode, optional applicationusagefilter? filter, optional long? limit ; since 4 0 the method gets the most frequently or recently used applications statistics, depending on parameter mode, which meet conditions in filter object maximum number of retrieved objects can be set in limit parameter applications which have not been used will not be included in results if an attribute endtime from filter object is less than or equal to starttime date, an empty array will be returned the errorcallback method is launched with these error types aborterror - if any system error occurred invalidvalueserror - if any of the input parameters contains an invalid value privilege level public privilege http //tizen org/privilege/apphistory read remark this method is available only on mobile devices an attempt to call this method on other profile will result in throwing notsupportederror exception parameters successcallback the method to call when the invocation ends successfully errorcallback optional nullable the method to call when an error occurs mode optional nullable the parameter defines a type of application usage to acquire by default, it is set to frequently filter optional nullable the filter for selecting period of time, from which data is accumulated by default, this parameter has attribute timespan set to 30 days limit optional nullable this parameter defines maximum count of objects applicationusage in returned array by default, it is set to 10 exceptions webapiexception with error type notsupportederror, if this feature is not supported with error type securityerror, if the application does not have the privilege to call this method with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example var successcallback = function appsusageinfo { appsusageinfo foreach function auinfo { console log "applicationid " + auinfo appid + ", count " + auinfo totalcount + ", duration " + auinfo totalduration + ", last used at " + auinfo lasttime ; } ; }; tizen application getappsusageinfo successcallback, null, "frequently", {timespan 7}, 5 ; output example applicationid w5ucnmnbvi basicui, count 17, duration 3471, last used at tue aug 01 2017 12 13 06 gmt+0200 cest applicationid org tizen message, count 16, duration 2964, last used at wed aug 02 2017 08 22 14 gmt+0200 cest applicationid api1getcap sysinfo, count 16, duration 1957, last used at tue aug 01 2017 12 13 03 gmt+0200 cest applicationid org tizen email, count 10, duration 1209, last used at fri jul 21 2017 10 15 09 gmt+0200 cest applicationid org tizen setting, count 5, duration 519, last used at wed aug 02 2017 06 52 51 gmt+0200 cest addappinfoeventlistener adds a listener for receiving any notification for changes in the list of installed applications on a device deprecated deprecated since 2 4 instead, let the app developers set a listener for getting notified for the changes add/remove/update of applications on a device using tizen package setpackageinfoeventlistener long addappinfoeventlistener applicationinformationeventcallback eventcallback ; since 2 0 it installs a callback that is triggered every time a change occurs on the list of installed applications on a device this change may occur due to a new installation, uninstallation, or update of an application when executed, the implementation must immediately return a listener id that identifies the listener after returning the id, the change detection operation is started asynchronously the applicationinformationeventcallback must be invoked every time a new application is installed, removed, or updated the change detection must continue until the removeappinfoeventlistener method is called with the corresponding listener identifier parameters eventcallback the method to call when a change on the installed applications is made return value long id of the listener that can be used to remove the listener later exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type unknownerror, if it fails to add a listener because of an unknown error code example var appeventcallback = { oninstalled function appinfo { console log 'the application ' + appinfo name + ' is installed' ; }, onupdated function appinfo { console log 'the application ' + appinfo name + ' is updated' ; }, onuninstalled function appid { console log 'the application ' + appid + ' is uninstalled' ; } }; var watchid = tizen application addappinfoeventlistener appeventcallback ; removeappinfoeventlistener removes the listener to stop receiving notifications for changes on the list of installed applications on a device deprecated deprecated since 2 4 instead, you can use tizen package unsetpackageinfoeventlistener void removeappinfoeventlistener long watchid ; since 2 0 parameters watchid an id that identifies the listener exceptions webapiexception with error type notfounderror, if the listener is not found with the specified id with error type unknownerror, if it fails to remove a listener because of an unknown error code example var appeventcallback = { oninstalled function appinfo { console log 'the application ' + appinfo name + ' is installed' ; }, onupdated function appinfo { console log 'the application ' + appinfo name + ' is updated' ; }, onuninstalled function appid { console log 'the application ' + appid + ' is uninstalled' ; } }; var watchid = tizen application addappinfoeventlistener appeventcallback ; tizen application removeappinfoeventlistener watchid ; addappstatuschangelistener adds a listener for receiving any notification for status changes of the installed applications on a device long addappstatuschangelistener statuseventcallback eventcallback, optional applicationid? appid ; since 4 0 parameters eventcallback the method to call when status of the installed applications is changed appid optional nullable the id of the application which status changes should be monitored if the application id is ommitted or it is equal to null, all applications status changes will be monitored return value long listener id that can be used to remove the listener later exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type invalidvalueserror, if the application id parameter is an empty string with error type aborterror, if it fails to add a listener code example function appstatuseventcallback appid, isactive { console log "the application " + appid + " has been " + isactive ? "activated" "deactivated" ; } var watchid = tizen application addappstatuschangelistener appstatuseventcallback ; output example the application testappid has been activated removeappstatuschangelistener removes the listener to stop receiving notifications for status changes of the installed applications on a device void removeappstatuschangelistener long watchid ; since 4 0 parameters watchid an id that identifies the listener exceptions webapiexception with error type aborterror, if it fails to remove listener code example function appstatuseventcallback appid, isactive { console log "the application " + appid + " has been " + isactive ? "activated" "deactivated" ; } try { var watchid = tizen application addappstatuschangelistener appstatuseventcallback ; tizen application removeappstatuschangelistener watchid ; console log "listener with id " + watchid + " has been removed" ; } catch err { console log "exception " + err name ; } output example listener with id 1 has been removed 2 3 applicationusagefilter this interface represents filter for defining period of time, which will be used as a condition in getappsusageinfo method dictionary applicationusagefilter { long? timespan; date? starttime; date? endtime; }; since 4 0 the maximum retention period is 90 days dictionary members long? timespan the attribute to store period of time, from which data is accumulated, in days the period of time begins timespan days ago and ends with current date if the attribute is given, the attributes starttime and endtime of this interface are not taken into an account if timespan is greater than 90, 90 will be used instead since 4 0 date? starttime the attribute to store the date, which is used as a lower bound for selecting data if only starttime attribute is given, by default endtime is equal to the current date if starttime date predates the 90 days from the current time, data will be accumulated from last 90 days since 4 0 date? endtime the attribute to store the date, which is used as an upper bound for selecting data if only endtime attribute is given, data will be accumulated from 90 days ago to endtime date since 4 0 2 4 application this interface defines the current application's information and the basic operations such as exit or hide for the current application [nointerfaceobject] interface application { readonly attribute applicationinformation appinfo; readonly attribute applicationcontextid contextid; void exit raises webapiexception ; void hide raises webapiexception ; requestedapplicationcontrol getrequestedappcontrol raises webapiexception ; long addeventlistener eventinfo event, eventcallback callback raises webapiexception ; void removeeventlistener long watchid raises webapiexception ; void broadcastevent eventinfo event, usereventdata data raises webapiexception ; void broadcasttrustedevent eventinfo event, usereventdata data raises webapiexception ; }; since 2 0 attributes readonly applicationinformation appinfo an attribute to store the application information for the current application since 2 0 readonly applicationcontextid contextid an attribute to store the id of a running application since 2 0 methods exit exits the current application void exit ; since 2 0 remark this method is not supported by web widget exceptions webapiexception with error type unknownerror, if any other error occurs code example var app = tizen application getcurrentapplication ; app exit ; hide hides the current application void hide ; since 2 0 remark this method is not supported by web widget exceptions webapiexception with error type unknownerror, if any other error occurs code example var app = tizen application getcurrentapplication ; app hide ; getrequestedappcontrol gets the requested application control passed to the current application requestedapplicationcontrol getrequestedappcontrol ; since 2 0 gets the requested application control that contains the application control passed by the launchappcontrol method from the calling application the requested application control contains the reason the application is launched and what it has to perform for example, an application might be launched to display an image on a page by another application's request in all of these cases, the application is responsible for checking the contents of the application control and responding appropriately when it is launched remark this method is not supported by web widget return value requestedapplicationcontrol the details of a requested application control exceptions webapiexception with error type unknownerror, if the application control cannot be retrieved because of an unknown error code example var reqappcontrol = tizen application getcurrentapplication getrequestedappcontrol ; if reqappcontrol { console log "requester appid " + reqappcontrol callerappid ; } addeventlistener adds a listener which will invoke a callback function when an event occurs long addeventlistener eventinfo event, eventcallback callback ; since 2 4 system events do not require an application identifier to be specified therefore, the appid attribute of the eventinfo dictionary should not be specified when listening for system events if it is specified, the event to listen for will be interpreted as an user event parameters event event which will invoke the callback callback callback function to be invoked when the event occurs return value long listener identifier exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type with error type unknownerror in any other error case code example var app = tizen application getcurrentapplication ; // for user events sender's application id and event name must be provided by using a dictionary // let's assume that at least two applications are installed function onlistinstalledapps appsinfo { var appid = null; if appsinfo length > 0 && app appinfo id != appsinfo[0] id { appid = appsinfo[0] id; } else if appsinfo length > 1 { appid = appsinfo[1] id; } if appid { var watchid = app addeventlistener {"appid" appid, "name" "custom_user_event"}, function event, data { console log "data " + json stringify data ; // do something } ; } } tizen application getappsinfo onlistinstalledapps ; removeeventlistener removes an event listener with a specified listener identifier void removeeventlistener long watchid ; since 2 4 parameters watchid listener identifier exceptions webapiexception with error type unknownerror in any other error case code example var app = tizen application getcurrentapplication ; // for user events sender's application id and event name must be provided by using a dictionary // let's assume that at least two applications are installed function onlistinstalledapps appsinfo { var appid = null; var watchid = null; if appsinfo length > 0 && app appinfo id != appsinfo[0] id { appid = appsinfo[0] id; } else if appsinfo length > 1 { appid = appsinfo[1] id; } if appid { watchid = app addeventlistener {"appid" appid, "name" "custom_user_event"}, function event, data { if watchid { app removeeventlistener watchid ; watchid = null; } } ; } } tizen application getappsinfo onlistinstalledapps ; broadcastevent broadcasts a user defined event to all the listeners which are listening for this event void broadcastevent eventinfo event, usereventdata data ; since 2 4 an application can listen to events from other applications however, it can only broadcast its own events therefore, the appid attribute of the eventinfo dictionary must be the identifier of the application which calls this method parameters event event to broadcast data user defined event data to broadcast exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type unknownerror in any other error case code example var mycustomdata = { foo 'bar' }; var app = tizen application getcurrentapplication ; app broadcastevent {"name" "custom_user_event"}, mycustomdata ; broadcasttrustedevent broadcasts a user defined event to all the trusted listeners which are listening for this event applications which have the same certificate as the sending application can receive the event void broadcasttrustedevent eventinfo event, usereventdata data ; since 2 4 an application can listen to events from other applications however, it can only broadcast its own events therefore, the appid attribute of the eventinfo dictionary must be the identifier of the application which calls this method parameters event trusted event to broadcast data user defined trusted event data to broadcast exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type unknownerror in any other error case code example var mytrustedcustomdata = { foo 'bar' }; var app = tizen application getcurrentapplication ; app broadcasttrustedevent {"name" "custom_user_event"}, mytrustedcustomdata ; 2 5 applicationinformation this interface defines the general information available to an installed application [nointerfaceobject] interface applicationinformation { readonly attribute applicationid id; readonly attribute domstring name; readonly attribute domstring iconpath; readonly attribute domstring version; readonly attribute boolean show; readonly attribute domstring[] categories; readonly attribute date installdate; readonly attribute long size raises webapiexception ; readonly attribute packageid packageid; }; since 1 0 attributes readonly applicationid id an attribute to store the identifier of an application for application management since 1 0 readonly domstring name an attribute to store the name of an application since 1 0 readonly domstring iconpath an attribute to store the icon path of an application since 1 0 readonly domstring version an attribute to store the version of an application since 1 0 readonly boolean show an attribute that determines whether the application information should be shown such as in menus since 1 0 readonly domstring[] categories an array of attributes to store the categories that the app belongs to since 2 0 readonly date installdate an attribute to store the application install/update time since 2 0 readonly long size an attribute to store the application size installed space since 2 0 privilege level public privilege http //tizen org/privilege/application info exceptions * webapiexception * with error type securityerror, if this attribute is not allowed readonly packageid packageid an attribute to store the package id of an application since 2 1 2 6 applicationcontext this interface defines the information available about a running application [nointerfaceobject] interface applicationcontext { readonly attribute applicationcontextid id; readonly attribute applicationid appid; }; since 1 0 attributes readonly applicationcontextid id an attribute to store the id of a running application since 1 0 readonly applicationid appid an attribute to store the id of an installed application since 1 0 2 7 applicationbatteryusage this interface defines information about battery usage of application [nointerfaceobject] interface applicationbatteryusage { readonly attribute applicationid appid; readonly attribute double batteryusage; }; since 4 0 attributes readonly applicationid avplay an attribute storing id of an application since 4 0 readonly double batteryusage an attribute which stores information about battery usage of an application with applicationid _appid_ battery usage is a ratio of battery consumption of the application with applicationid _appid_ to the total battery consumption of all applications the attribute value scales from 0 to 1, the higher value, the more battery is consumed since 4 0 2 8 applicationusage this interface defines information about usage of application [nointerfaceobject] interface applicationusage { readonly attribute applicationid appid; readonly attribute unsigned long totalcount; readonly attribute unsigned long totalduration; readonly attribute date lasttime; }; since 4 0 attributes readonly applicationid appid an attribute to store the id of an application since 4 0 readonly unsigned long totalcount an attribute to store the total number of times the application was in the foreground since 4 0 readonly unsigned long totalduration an attribute to store the total time of application usage in seconds since 4 0 readonly date long lasttime an attribute to store the last time when the application was used since 4 0 2 9 applicationcontroldata this interface defines a key/value pair used to pass data between applications through the applicationcontrol interface [constructor domstring key, domstring[] value ] interface applicationcontroldata { attribute domstring key; attribute domstring[] value; }; since 2 0 code example var appcontroldata = new tizen applicationcontroldata "image", [imagedata1] ; constructors applicationcontroldata domstring key, domstring[] value ; attributes domstring key an attribute to store the name of a key since 2 0 domstring[] value an attribute to store the value associated with a key since 2 0 2 10 applicationcontrol this interface consists of an operation, uri, mime type, and data it describes an action to be performed by other applications and is passed to launch other applications if the system gets the application control request, it finds the corresponding application to be launched with the delivered application control and launches the selected application [constructor domstring operation, optional domstring? uri, optional domstring? mime, optional domstring? category, optional applicationcontroldata[]? data, optional applicationcontrollaunchmode? launchmode ] interface applicationcontrol { attribute domstring operation; attribute domstring? uri; attribute domstring? mime; attribute domstring? category; attribute applicationcontroldata[] data; attribute applicationcontrollaunchmode launchmode; }; since 2 0 code example var appcontrol = new tizen applicationcontrol "http //tizen org/appcontrol/operation/view", null, "image/jpeg", null, [new tizen applicationcontroldata "images", [imagedata1, imagedata2] ] ; constructors applicationcontrol domstring operation, optional domstring? uri, optional domstring? mime, optional domstring? category, optional applicationcontroldata[]? data, optional applicationcontrollaunchmode? launchmode ; attributes domstring operation an attribute to store the string that defines the action to be performed by an application control since 2 0 domstring uri nullable an attribute to store the uri needed by an application control since 2 0 domstring mime nullable an attribute to store the mime type of content since 2 0 domstring category nullable an attribute to store the category of the application to be launched since 2 0 applicationcontroldata[] data an array of attributes to store the data needed for an application control since 2 0 applicationcontrollaunchmode launchmode an attribute to specify launch mode default application launch mode is _single_ since 2 4 2 11 requestedapplicationcontrol this interface has an application control information requested and passed from another application and is passed to launch other applications the newly launched application can get the requested application control through the getrequestedappcontrol method, and send the results to the calling application through the replyresult method after performing the required action requested by the calling application [nointerfaceobject] interface requestedapplicationcontrol { readonly attribute applicationcontrol appcontrol; readonly attribute applicationid callerappid; void replyresult optional applicationcontroldata[]? data raises webapiexception ; void replyfailure raises webapiexception ; }; since 2 0 attributes readonly applicationcontrol appcontrol an attribute to store the application control object that describes the caller application's request it contains the information that the calling application passed to _launchappcontrol_ since 2 0 readonly applicationid callerappid an attribute to store the caller application's id since 2 1 methods replyresult sends the results to the caller application void replyresult optional applicationcontroldata[]? data ; since 2 0 parameters data optional nullable an array of applicationcontroldata objects exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type notfounderror, if the caller app is not alive or there is no response from the caller app with error type unknownerror, if the reply request fails because of an unknown error code example var reqappcontrol = tizen application getcurrentapplication getrequestedappcontrol ; if reqappcontrol { console log "requester appid " + reqappcontrol callerappid ; var appcontrol = reqappcontrol appcontrol; if appcontrol operation == "http //tizen org/appcontrol/operation/pick" { var data = new tizen applicationcontroldata "http //tizen org/appcontrol/data/selected", ["image1 jpg"] ; reqappcontrol replyresult [data] ; } } replyfailure notifies the calling application that the application failed to perform the requested action void replyfailure ; since 2 0 exceptions webapiexception with error type notfounderror, if the caller app is not alive or there is no response from the caller app with error type unknownerror, if the reply request fails because of an unknown error code example var reqappcontrol = tizen application getcurrentapplication getrequestedappcontrol ; if reqappcontrol { console log "requester appid " + reqappcontrol callerappid ; var appcontrol = reqappcontrol appcontrol; if appcontrol operation == "http //tizen org/appcontrol/operation/pick" { reqappcontrol replyfailure ; } } 2 12 applicationcertificate this interface defines the certificate information of an installed application [nointerfaceobject] interface applicationcertificate { readonly attribute domstring type; readonly attribute domstring value; }; since 2 0 attributes readonly domstring type an attribute to store the type of the application certificate since 2 0 readonly domstring value an attribute to store the value of the application certificatesince 2 0 2 13 applicationmetadata this interface defines the meta data of an installed application [nointerfaceobject] interface applicationmetadata { readonly attribute domstring key; readonly attribute domstring value; }; since 2 2 attributes readonly domstring key an attribute to store the key of the application meta data since 2 2 readonly domstring value an attribute to store the value of the application meta data since 2 2 2 14 batteryusageinfoarraysuccesscallback this callback interface specifies a success callback that is invoked when the battery usage per application array is retrieved [callback=functiononly, nointerfaceobject] interface batteryusageinfoarraysuccesscallback { void onsuccess applicationbatteryusage[] batteryinfoarray ; }; since 4 0 this callback interface specifies a success method with an array of applicationbatteryusage objects as an input parameter it is used in applicationmanager getbatteryusageinfo method methods onsuccess called when the asynchronous call completes successfully void onsuccess applicationbatteryusage[] batteryinfoarray ; since 4 0 remark example of usage can be find at getbatteryusageinfo code example parameters batteryinfoarray an array of data containing information about battery usage per application 2 15 appsusageinfoarraysuccesscallback this callback interface specifies a success callback that is invoked when the application usage statistics array is retrieved [callback=functiononly, nointerfaceobject] interface appsusageinfoarraysuccesscallback { void onsuccess applicationusage[] appsinfoarray ; }; since 4 0 this callback interface specifies a success method with an array of applicationusage objects as an input parameter it is used in applicationmanager getappsusageinfo method methods onsuccess called when the asynchronous call completes successfully void onsuccess applicationusage[] appsinfoarray ; since 4 0 remark an example of usage can be find at getappsusageinfo code example parameters appsinfoarray an array of data containing information about usage per application 2 16 applicationinformationarraysuccesscallback this callback interface specifies a success callback that is invoked when the installed application list is retrieved [callback=functiononly, nointerfaceobject] interface applicationinformationarraysuccesscallback { void onsuccess applicationinformation[] informationarray ; }; since 1 0 this callback interface specifies a success method with an array of applicationinformation objects as an input parameter it is used in applicationmanager getappsinfo methods onsuccess called when the asynchronous call completes successfully void onsuccess applicationinformation[] informationarray ; since 1 0 parameters informationarray a list of installed applications code example function onlistinstalledapps applications { for var i = 0; i < applications length; i++ console log "id " + applications[i] id ; } tizen application getappsinfo onlistinstalledapps ; 2 17 findappcontrolsuccesscallback this callback interface specifies a success callback that is invoked when the system has finished searching applications that match a specific application control [callback=functiononly, nointerfaceobject] interface findappcontrolsuccesscallback { void onsuccess applicationinformation[] informationarray, applicationcontrol appcontrol ; }; since 2 0 this callback interface specifies a success method with an array of applicationinformation objects and application control as an input parameter it is used in applicationmanager findappcontrol methods onsuccess called when the asynchronous call completes successfully void onsuccess applicationinformation[] informationarray, applicationcontrol appcontrol ; since 2 0 parameters informationarray a list of installed applications appcontrol the application control that is passed to applicationmanager findappcontrol code example var appcontrol = new tizen applicationcontrol "http //tizen org/appcontrol/operation/pick", null, "image/jpeg", null ; // findappcontrolsuccesscallback instance function successcb appinfos, appcontrol { // appcontrol is same object with the value passed as first parameter to findappcontrol var appcontrolreplycallback = { // callee sent a reply onsuccess function data { for var i = 0; i < data length; i++ { if data[i] key == "http //tizen org/appcontrol/data/selected" { console log 'selected image is ' + data[i] value[0] ; } } }, // callee returned failure onfailure function { console log 'the launch application control failed' ; } } var appid = appinfos[0] id; // select first app's id tizen application launchappcontrol appcontrol, appid, function {console log "launch application control succeed" ; }, function e {console log "launch application control failed reason " + e message ; }, appcontrolreplycallback ; } tizen application findappcontrol appcontrol, successcb ; 2 18 applicationcontextarraysuccesscallback this callback interface specifies a success callback that is invoked when the list of running applications is retrieved [callback=functiononly, nointerfaceobject] interface applicationcontextarraysuccesscallback { void onsuccess applicationcontext[] contexts ; }; since 1 0 this callback interface specifies a success method with an array of applicationcontext objects as an input parameter it is used in applicationmanager getappscontext methods onsuccess called when _applicationmanager getappscontext _ completes successfully void onsuccess applicationcontext[] contexts ; since 1 0 parameters contexts a list of running applications 2 19 applicationcontroldataarrayreplycallback the applicationcontroldataarrayreplycallback callback specifies success callbacks that are invoked as a reply from the requested application control within the application control requester [callback, nointerfaceobject] interface applicationcontroldataarrayreplycallback { void onsuccess optional applicationcontroldata[]? data ; void onfailure ; }; since 2 0 this callback interface specifies two methods onsuccess - invoked if the callee application calls requestedapplicationcontrol replyresult onfailure - invoked if the callee application calls requestedapplicationcontrol replyfailure code example var appcontrol = new tizen applicationcontrol "http //tizen org/appcontrol/operation/pick", null, "image/jpeg", null ; // applicationcontroldataarrayreplycallback instance var appcontrolreplycallback = { // callee sent a reply onsuccess function data { for var i = 0; i < data length; i++ { if data[i] key == "http //tizen org/appcontrol/data/selected" { console log 'selected image is ' + data[i] value[0] ; } } }, // callee returned failure onfailure function { console log 'the launch application control failed' ; } } tizen application launchappcontrol appcontrol, null, function {console log "launch application control succeed" ; }, function e {console log "launch application control failed reason " + e message ; }, appcontrolreplycallback ; methods onsuccess called when the callee application calls requestedapplicationcontrol replyresult void onsuccess optional applicationcontroldata[]? data ; since 2 0 parameters data optional nullable an array of applicationcontroldata objects onfailure called when the callee application calls requestedapplicationcontrol replyfailure void onfailure ; since 2 0 2 16 applicationinformationeventcallback the applicationinformationeventcallback specifies listener for subscribing for notifications of changes in the list of installed applications on a device [callback, nointerfaceobject] interface applicationinformationeventcallback { void oninstalled applicationinformation info ; void onupdated applicationinformation info ; void onuninstalled applicationid id ; }; since 1 0 this callback interface specifies methods that are invoked when an application is installed, updated, or uninstalled code example var appeventcallback = { oninstalled function appinfo { console log 'the application ' + appinfo name + ' is installed' ; }, onupdated function appinfo { console log 'the application ' + appinfo name + ' is updated' ; }, onuninstalled function appid { console log 'the application ' + appid + ' is uninstalled' ; } }; var watchid = tizen application addappinfoeventlistener appeventcallback ; methods oninstalled called when an application is installed void oninstalled applicationinformation info ; since 1 0 parameters info the application information of the installed application onupdated called when an application is updated void onupdated applicationinformation info ; since 1 0 parameters info the application information of the updated application onuninstalled called when an application is uninstalled void onuninstalled applicationid id ; since 1 0 parameters id the id of the uninstalled application 2 20 systemeventdata the systemeventdata interface defines what is retrieved from the event listener [nointerfaceobject] interface systemeventdata { attribute domstring value; attribute domstring type; }; since 2 4 platform modules will be able to broadcast system events in a future tizen release 2 21 eventcallback the eventcallback interface specifies a callback for getting notified when a specified event occurs [callback=functiononly, nointerfaceobject] interface eventcallback { void onevent eventinfo event, eventdata data ; }; since 2 4 methods onevent called when the event occurs void onevent eventinfo event, eventdata data ; since 2 4 parameters event broadcasted event which invokes this callback data broadcasted event data code example var app = tizen application getcurrentapplication ; // for user events sender's application id and event name must be provided by using a dictionary // let's assume that at least two applications are installed function onlistinstalledapps appsinfo { var appid = null; if appsinfo length > 0 && app appinfo id != appsinfo[0] id { appid = appsinfo[0] id; } else if appsinfo length > 1 { appid = appsinfo[1] id; } var eventcb = function event, data { console log "data " + json stringify data ; // do something }; if appid { var watchid = app addeventlistener {"appid" appid, "name" "custom_user_event"}, eventcb ; } } tizen application getappsinfo onlistinstalledapps ; 2 22 statuseventcallback the statuseventcallback interface specifies a callback for getting notified when status of the installed application has been changed [callback=functiononly, nointerfaceobject] interface statuseventcallback { void onchange applicationid appid, boolean isactive ; }; since 4 0 methods onchange called when the status event occurs void onchange applicationid appid, boolean isactive ; since 4 0 example of using can be find at addappstatuschangelistener code example parameters appid id of the application that status has been changed isactive the new status of the application 2 23 eventinfo the eventinfo dictionary identifies an event with information such as event name if it is an user event, the broadasting application's identifier is also specified dictionary eventinfo { applicationid appid; domstring name; }; since 2 4 system events do not require an application identifier to be specified if one is specified, the event will be interpreted as an user event dictionary members applicationid appid the unique identifier of the application which is broadcasting an event an application can listen to events from other applications however, it can only broadcast its own events therefore, when broadcasting an event, this dictionary member must be the identifier of the application which is broadcasting the event system events do not require an application identifier to be specified if one is specified, the event will be interpreted as an user event since 2 4 domstring name name which describes the event must only contain the ascii characters "[a-z][a-z][0-9]_" and may not begin with a digit must be at least 1 byte in length and not exceed the maximum name length of 127 bytes since 2 4 3 related feature you can check if this api is supported with tizen systeminfo getcapability and decide enable/disable codes that need this api to guarantee the running of the application on a device which has battery, declare the following feature requirement in the config file http //tizen org/feature/battery for more information, see application filtering 4 full webidl module application { typedef domstring applicationid; typedef domstring applicationcontextid; typedef object usereventdata; typedef systemeventdata or usereventdata eventdata; enum applicationcontrollaunchmode { "single", "group" }; enum applicationusagemode { "recently", "frequently" }; [nointerfaceobject] interface applicationmanagerobject { readonly attribute applicationmanager application; }; tizen implements applicationmanagerobject; [nointerfaceobject] interface applicationmanager { application getcurrentapplication raises webapiexception ; void kill applicationcontextid contextid, optional successcallback? successcallback, optional errorcallback? errorcallback raises webapiexception ; void findappcontrol applicationcontrol appcontrol, findappcontrolsuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; void getappscontext applicationcontextarraysuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; applicationcontext getappcontext optional applicationcontextid? contextid raises webapiexception ; void getappsinfo applicationinformationarraysuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; applicationinformation getappinfo optional applicationid? id raises webapiexception ; applicationcertificate[] getappcerts optional applicationid? id raises webapiexception ; domstring getappshareduri optional applicationid? id raises webapiexception ; applicationmetadata[] getappmetadata optional applicationid? id raises webapiexception ; void getbatteryusageinfo batteryusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional long? days, optional long? limit raises webapiexception ; void getappsusageinfo appsusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional applicationusagemode? mode, optional applicationusagefilter? filter, optional long? limit raises webapiexception ; long addappstatuschangelistener statuseventcallback eventcallback, optional applicationid? appid raises webapiexception ; void removeappstatuschangelistener long watchid raises webapiexception ; }; dictionary applicationusagefilter { long? timespan; date? starttime; date? endtime; }; [nointerfaceobject] interface application { readonly attribute applicationinformation appinfo; readonly attribute applicationcontextid contextid; void exit raises webapiexception ; void hide raises webapiexception ; requestedapplicationcontrol getrequestedappcontrol raises webapiexception ; long addeventlistener eventinfo event, eventcallback callback raises webapiexception ; void removeeventlistener long watchid raises webapiexception ; void broadcastevent eventinfo event, usereventdata data raises webapiexception ; void broadcasttrustedevent eventinfo event, usereventdata data raises webapiexception ; }; [nointerfaceobject] interface applicationinformation { readonly attribute applicationid id; readonly attribute domstring name; readonly attribute domstring iconpath; readonly attribute domstring version; readonly attribute boolean show; readonly attribute domstring[] categories; readonly attribute date installdate; readonly attribute long size raises webapiexception ; readonly attribute packageid packageid; }; [nointerfaceobject] interface applicationcontext { readonly attribute applicationcontextid id; readonly attribute applicationid appid; }; [nointerfaceobject] interface applicationbatteryusage { readonly attribute applicationid appid; readonly attribute double batteryusage; }; [nointerfaceobject] interface applicationusage { readonly attribute applicationid appid; readonly attribute unsigned long totalcount; readonly attribute unsigned long totalduration; readonly attribute date lasttime; }; [constructor domstring key, domstring[] value ] interface applicationcontroldata { attribute domstring key; attribute domstring[] value; }; [constructor domstring operation, optional domstring? uri, optional domstring? mime, optional domstring? category, optional applicationcontroldata[]? data, optional applicationcontrollaunchmode? launchmode ] interface applicationcontrol { attribute domstring operation; attribute domstring? uri; attribute domstring? mime; attribute domstring? category; attribute applicationcontroldata[] data; attribute applicationcontrollaunchmode launchmode; }; [nointerfaceobject] interface requestedapplicationcontrol { readonly attribute applicationcontrol appcontrol; readonly attribute applicationid callerappid; void replyresult optional applicationcontroldata[]? data raises webapiexception ; void replyfailure raises webapiexception ; }; [nointerfaceobject] interface applicationcertificate { readonly attribute domstring type; readonly attribute domstring value; }; [nointerfaceobject] interface applicationmetadata { readonly attribute domstring key; readonly attribute domstring value; }; [callback=functiononly, nointerfaceobject] interface batteryusageinfoarraysuccesscallback { void onsuccess applicationbatteryusage[] batteryinfoarray ; }; [callback=functiononly, nointerfaceobject] interface appsusageinfoarraysuccesscallback { void onsuccess applicationusage[] appsinfoarray ; }; [callback=functiononly, nointerfaceobject] interface applicationinformationarraysuccesscallback { void onsuccess applicationinformation[] informationarray ; }; [callback=functiononly, nointerfaceobject] interface findappcontrolsuccesscallback { void onsuccess applicationinformation[] informationarray, applicationcontrol appcontrol ; }; [callback=functiononly, nointerfaceobject] interface applicationcontextarraysuccesscallback { void onsuccess applicationcontext[] contexts ; }; [callback, nointerfaceobject] interface applicationcontroldataarrayreplycallback { void onsuccess optional applicationcontroldata[]? data ; void onfailure ; }; [callback, nointerfaceobject] interface applicationinformationeventcallback { void oninstalled applicationinformation info ; void onupdated applicationinformation info ; void onuninstalled applicationid id ; }; [nointerfaceobject] interface systemeventdata { attribute domstring value; attribute domstring type; }; [callback=functiononly, nointerfaceobject] interface eventcallback { void onevent eventinfo event, eventdata data ; }; [callback=functiononly, nointerfaceobject] interface statuseventcallback { void onchange applicationid appid, boolean isactive ; }; dictionary eventinfo { applicationid appid; domstring name; }; };
Develop Smart Hospitality Display
apiapplication api this application api provides a way to access application management the applicationcontrol interface consists of an operation, uri, and mime type and also describes an action to be performed by other applications and can carry the result from the subsequent application the applicationmanager interface also provides methods to handle the application lifecycle, to access the installed applications on the device, and to let an application be notified of a change in the application list the application interface defines the current application's information and the basic operations for the current application such as exit or hide since tizen 2 4 the application interface provides application event broadcasting and listening features an application can broadcast user events to other listening applications and listen to broadcasted user events from other applications in a future tizen release, applications will also be able to receive pre-defined system events from the platform for more information on the application features, see application guide, application group guide or application control guide since 1 0 summary of interfaces and methods interface method applicationmanagerobject applicationmanager application getcurrentapplication void kill applicationcontextid contextid, optional successcallback? successcallback, optional errorcallback? errorcallback void findappcontrol applicationcontrol appcontrol, findappcontrolsuccesscallback successcallback, optional errorcallback? errorcallback void getappscontext applicationcontextarraysuccesscallback successcallback, optional errorcallback? errorcallback applicationcontext getappcontext optional applicationcontextid? contextid void getappsinfo applicationinformationarraysuccesscallback successcallback, optional errorcallback? errorcallback applicationinformation getappinfo optional applicationid? id applicationcertificate[] getappcerts optional applicationid? id domstring getappshareduri optional applicationid? id applicationmetadata[] getappmetadata optional applicationid? id void getbatteryusageinfo batteryusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional long? days, optional long? limit void getappsusageinfo appsusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional applicationusagemode? mode, optional applicationusagefilter? filter, optional long? limit long addappstatuschangelistener statuseventcallback eventcallback, optional applicationid? appid void removeappstatuschangelistener long watchid applicationusagefilter application void exit void hide requestedapplicationcontrol getrequestedappcontrol long addeventlistener eventinfo event, eventcallback callback void removeeventlistener long watchid void broadcastevent eventinfo event, usereventdata data void broadcasttrustedevent eventinfo event, usereventdata data applicationinformation applicationcontext applicationbatteryusage applicationusage applicationcontroldata applicationcontrol requestedapplicationcontrol void replyresult optional applicationcontroldata[]? data void replyfailure applicationcertificate applicationmetadata batteryusageinfoarraysuccesscallback void onsuccess applicationbatteryusage[] batteryinfoarray appsusageinfoarraysuccesscallback void onsuccess applicationusage[] appsinfoarray applicationinformationarraysuccesscallback void onsuccess applicationinformation[] informationarray findappcontrolsuccesscallback void onsuccess applicationinformation[] informationarray, applicationcontrol appcontrol applicationcontextarraysuccesscallback void onsuccess applicationcontext[] contexts applicationcontroldataarrayreplycallback void onsuccess optional applicationcontroldata[]? data void onfailure applicationinformationeventcallback void oninstalled applicationinformation info void onupdated applicationinformation info void onuninstalled applicationid id systemeventdata eventcallback void onevent eventinfo event, eventdata data statuseventcallback void onchange applicationid appid, boolean isactive eventinfo 1 type definitions 1 1 applicationid the unique id for an installed application typedef domstring applicationid; since 1 0 1 2 applicationcontextid the unique id for a running application typedef domstring applicationcontextid; since 1 0 1 3 usereventdata specifies the user event data typedef object usereventdata; since 2 4 1 4 eventdata specifies the user or system defined event data typedef systemeventdata or usereventdata eventdata; since 2 4 1 5 applicationcontrollaunchmode specifies the application launch mode when it is launched by launchappcontrol this value may be overriden if application launched by launchappcontrol has value single configured in application manifest enum applicationcontrollaunchmode { "single", "group" }; since 2 4 the launch modes defined by this enumerator are single - launch application as standalone instance group - launch application in subgroup 1 6 applicationusagemode specifies the possible modes of getting statistics of application usage enum applicationusagemode { "recently", "frequently" }; since 4 0 possible types are recently - indicates most recently used applications, in a descending order of the application use counts frequently - indicates most frequently used applications, in a descending order of the application use counts 2 interfaces 2 1 applicationmanagerobject this interface defines what is instantiated by the tizen object on the tizen platform [nointerfaceobject] interface applicationmanagerobject { readonly attribute applicationmanager application; }; tizen implements applicationmanagerobject; since 2 0 the tizen application object allows access to the application api's functionality 2 2 applicationmanager the applicationmanager interface provides methods to retrieve application information, install application, etc [nointerfaceobject] interface applicationmanager { application getcurrentapplication raises webapiexception ; void kill applicationcontextid contextid, optional successcallback? successcallback, optional errorcallback? errorcallback raises webapiexception ; void findappcontrol applicationcontrol appcontrol, findappcontrolsuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; void getappscontext applicationcontextarraysuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; applicationcontext getappcontext optional applicationcontextid? contextid raises webapiexception ; void getappsinfo applicationinformationarraysuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; applicationinformation getappinfo optional applicationid? id raises webapiexception ; applicationcertificate[] getappcerts optional applicationid? id raises webapiexception ; domstring getappshareduri optional applicationid? id raises webapiexception ; applicationmetadata[] getappmetadata optional applicationid? id raises webapiexception ; void getbatteryusageinfo batteryusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional long? days, optional long? limit raises webapiexception ; void getappsusageinfo appsusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional applicationusagemode? mode, optional applicationusagefilter? filter, optional long? limit raises webapiexception ; long addappstatuschangelistener statuseventcallback eventcallback, optional applicationid? appid raises webapiexception ; void removeappstatuschangelistener long watchid raises webapiexception ; }; since 2 0 methods getcurrentapplication gets the application object defining the current application application getcurrentapplication ; since 2 0 remark this method is not supported by web widget return value application the data structure that defines the current application exceptions webapiexception with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var app = tizen application getcurrentapplication ; console log "current application's app id is " + app appinfo id ; kill kills an application with the specified application context id void kill applicationcontextid contextid, optional successcallback? successcallback, optional errorcallback? errorcallback ; since 2 0 the errorcallback method is launched with these error types notfounderror - if the context is not found with the specified context id invalidvalueserror - if any of the input parameters contain an invalid value or if the specified context id matches the context id of the calling application unknownerror - if any other error occurs privilege level partner privilege http //tizen org/privilege/appmanager kill parameters contextid the identifier of the application to kill successcallback optional nullable the method to invoke when an application is killed successfully errorcallback optional nullable the method to invoke when an error occurs exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type securityerror, if the application does not have the privilege to call this method code example function onkillsuccess { console log "application terminated successfully" ; } function onrunningappscontext contexts { // let's assume that the application "targetapp0 main" has been installed var targetid = "targetapp0 main"; for var i = 0; i < contexts length; i++ { if contexts[i] appid == targetid { tizen application kill contexts[i] id, onkillsuccess ; } } } tizen application getappscontext onrunningappscontext ; findappcontrol finds which applications can be launched with the given application control void findappcontrol applicationcontrol appcontrol, findappcontrolsuccesscallback successcallback, optional errorcallback? errorcallback ; since 2 0 an application can get a list of other applications that can be launched with the application control the errorcallback method is launched with these error types notfounderror - if the application is not found with the given appcontrol unknownerror - if any other error occurs parameters appcontrol a data structure describing application control details successcallback the method to call that returns a list of application information errorcallback optional nullable the method to call when an error occurs exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example var appcontrol = new tizen applicationcontrol "http //tizen org/appcontrol/operation/pick", null, "image/jpeg", null ; function successcb appinfos, appcontrol { // appcontrol is same object with the value passed as first parameter to findappcontrol var appcontrolreplycallback = { // callee sent a reply onsuccess function data { for var i = 0; i < data length; i++ { if data[i] key == "http //tizen org/appcontrol/data/selected" { console log 'selected image is ' + data[i] value[0] ; } } }, // callee returned failure onfailure function { console log 'the launch application control failed' ; } } var appid = appinfos[0] id; // select first app's id tizen application launchappcontrol appcontrol, appid, function {console log "launch application control succeed" ; }, function e {console log "launch application control failed reason " + e message ; }, appcontrolreplycallback ; } tizen application findappcontrol appcontrol, successcb ; getappscontext gets a list of application contexts for applications that are currently running on a device the information contained for each application corresponds to the application state at the time when the list had been generated void getappscontext applicationcontextarraysuccesscallback successcallback, optional errorcallback? errorcallback ; since 2 0 the errorcallback method is launched with this error type unknownerror - if an unknown error occurs parameters successcallback the method to call when the invocation ends successfully errorcallback optional nullable the method to call when an error occurs exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example function onrunningappscontext contexts { for var i = 0; i < contexts length; i++ console log "id " + contexts[i] id ; } tizen application getappscontext onrunningappscontext ; getappcontext gets the application context for the specified application context id if the id is set to null or is not set at all, the method returns the application context of the current application the list of running applications and their application ids is obtained with getappscontext applicationcontext getappcontext optional applicationcontextid? contextid ; since 2 0 parameters contextid optional nullable a string representing an application context id if the id is not provided, the application context of the calling application is returned return value applicationcontext a data structure that lists running application details exceptions webapiexception with error type notfounderror, if the application context is not found with the specified id with error type unknownerror, if the application context cannot be retrieved because of an unknown error code example var appcontext = tizen application getappcontext null ; console log "application context retrieved for app " + appcontext appid ; getappsinfo gets the list of installed applications' information on a device the information contained on each application corresponds to the application state at the time when the list had been generated void getappsinfo applicationinformationarraysuccesscallback successcallback, optional errorcallback? errorcallback ; since 2 0 the errorcallback method is launched with this error type unknownerror - if an unknown error occurs parameters successcallback the method to call when the invocation ends successfully errorcallback optional nullable the method to call when an error occurs exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example function onlistinstalledapps applications { for var i = 0; i < applications length; i++ console log "id " + applications[i] id ; } tizen application getappsinfo onlistinstalledapps ; getappinfo gets application information for a specified application id applicationinformation getappinfo optional applicationid? id ; since 2 0 if the id is set to null or not set at all, it returns application information for the current application the list of installed applications and their application ids is obtained with getappsinfo parameters id optional nullable a string representing an application id if the id is not provided, the application information of the calling application is returned return value applicationinformation the information of an application exceptions webapiexception with error type notfounderror, if the application is not found with the specified id with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var appinfo = tizen application getappinfo null ; console log "current application name " + appinfo name ; getappcerts gets application certificates for a specified application id applicationcertificate[] getappcerts optional applicationid? id ; since 2 0 if the id is set to null or not set at all, it returns application certificates for the current application the certificate types are listed below author_root - author root certificate author_intermediate - author intermediate certificate author_signer - author signer certificate distributor_root - distributor root certificate distributor_intermediate - distributor intermediate certificate distributor_signer - distributor signer certificate distributor2_root - distributor2 root certificate distributor2_intermediate - distributor2 intermediate certificate distributor2_signer - distributor2 signer certificate privilege level partner privilege http //tizen org/privilege/appmanager certificate parameters id optional nullable a string representing an application id if the id is not provided, the application certificate of the calling application is returned return value applicationcertificate[] array of certificate information of a specified application exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type notfounderror, if the application is not found with the specified id with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var appcerts = tizen application getappcerts null ; for var i = 0; i < appcerts length; i++ { console log "#" + i + " type " + appcerts[i] type ; console log "#" + i + " value " + appcerts[i] value ; } getappshareduri gets the uri of the read-only shared directory of an application for a specified application id domstring getappshareduri optional applicationid? id ; since 2 1 the shared directory is used to export data to other applications if the id is set to null or not set at all, it returns the shared directory uri for the current application parameters id optional nullable a string representing an application id if the id is not provided, the shared directory uri of the calling application is returned return value domstring the shared directory uri of an application exceptions webapiexception with error type notfounderror, if the application is not found with the specified id with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var shareddir = tizen application getappshareduri null ; console log "shared directory " + shareddir ; getappmetadata gets the application meta data array for a specified application id applicationmetadata[] getappmetadata optional applicationid? id ; since 2 2 if the id is set to null or not set at all, it returns the application meta data array for the current application privilege level public privilege http //tizen org/privilege/application info parameters id optional nullable a string representing an application id if the id is not provided, the application metadata array of the calling application is returned return value applicationmetadata[] array of meta data of a specified application if there are no meta data for a specified application, an empty array is returned exceptions webapiexception with error type securityerror, if the application does not have the privilege to call this method with error type notfounderror, if the application is not found with the specified id with error type unknownerror, if the application cannot be retrieved because of an unknown error code example var metadataarray = tizen application getappmetadata null ; console log "size of metadata " + metadataarray length ; getbatteryusageinfo gets information about battery usage per application void getbatteryusageinfo batteryusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional long? days, optional long? limit ; since 4 0 this method provides information about battery usage collected in last days days, through callback successcallback maximum number of retrieved objects can be set in limit parameter if the days is not given, this method retrieves information about battery usage since the time the device was unplugged, after reaching full charge the errorcallback method is launched with these error types aborterror - if any system error occurred invalidvalueserror - if any of the input parameters contains an invalid value privilege level public privilege http //tizen org/privilege/apphistory read remark this method is available only on mobile devices an attempt to call this method on other profile will result in throwing notsupportederror exception parameters successcallback the method to call when the invocation ends successfully errorcallback optional nullable the method to call when an error occurs days optional nullable number of days if parameter was not given, method will behave as described above limit optional nullable this parameter defines maximum number of applicationbatteryusage objects in an array in successcallback callback by default, it is set to 30 exceptions webapiexception with error type notsupportederror, if this feature is not supported with error type securityerror, if the application does not have the privilege to call this method with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example var successcallback = function batteryusageinfoarray { batteryusageinfoarray foreach function abuinfo { console log "applicationid " + abuinfo appid + ", usage " + abuinfo batteryusage ; } ; }; tizen application getbatteryusageinfo successcallback ; output example applicationid 3gwrkepxz5 basicui3, usage 51 78 applicationid org tizen homescreen-efl, usage 28 72 applicationid org tizen lockscreen, usage 6 05 applicationid org tizen quickpanel, usage 4 83 applicationid org tizen indicator, usage 3 69 applicationid org tizen calendar widget, usage 1 79 applicationid org tizen volume, usage 1 34 applicationid org tizen powerkey-syspopup, usage 0 98 applicationid org tizen task-mgr, usage 0 46 applicationid org tizen msg-manager, usage 0 36 getappsusageinfo gets the usage statistics of applications void getappsusageinfo appsusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional applicationusagemode? mode, optional applicationusagefilter? filter, optional long? limit ; since 4 0 the method gets the most frequently or recently used applications statistics, depending on parameter mode, which meet conditions in filter object maximum number of retrieved objects can be set in limit parameter applications which have not been used will not be included in results if an attribute endtime from filter object is less than or equal to starttime date, an empty array will be returned the errorcallback method is launched with these error types aborterror - if any system error occurred invalidvalueserror - if any of the input parameters contains an invalid value privilege level public privilege http //tizen org/privilege/apphistory read remark this method is available only on mobile devices an attempt to call this method on other profile will result in throwing notsupportederror exception parameters successcallback the method to call when the invocation ends successfully errorcallback optional nullable the method to call when an error occurs mode optional nullable the parameter defines a type of application usage to acquire by default, it is set to frequently filter optional nullable the filter for selecting period of time, from which data is accumulated by default, this parameter has attribute timespan set to 30 days limit optional nullable this parameter defines maximum count of objects applicationusage in returned array by default, it is set to 10 exceptions webapiexception with error type notsupportederror, if this feature is not supported with error type securityerror, if the application does not have the privilege to call this method with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter code example var successcallback = function appsusageinfo { appsusageinfo foreach function auinfo { console log "applicationid " + auinfo appid + ", count " + auinfo totalcount + ", duration " + auinfo totalduration + ", last used at " + auinfo lasttime ; } ; }; tizen application getappsusageinfo successcallback, null, "frequently", {timespan 7}, 5 ; output example applicationid w5ucnmnbvi basicui, count 17, duration 3471, last used at tue aug 01 2017 12 13 06 gmt+0200 cest applicationid org tizen message, count 16, duration 2964, last used at wed aug 02 2017 08 22 14 gmt+0200 cest applicationid api1getcap sysinfo, count 16, duration 1957, last used at tue aug 01 2017 12 13 03 gmt+0200 cest applicationid org tizen email, count 10, duration 1209, last used at fri jul 21 2017 10 15 09 gmt+0200 cest applicationid org tizen setting, count 5, duration 519, last used at wed aug 02 2017 06 52 51 gmt+0200 cest addappinfoeventlistener adds a listener for receiving any notification for changes in the list of installed applications on a device deprecated deprecated since 2 4 instead, let the app developers set a listener for getting notified for the changes add/remove/update of applications on a device using tizen package setpackageinfoeventlistener long addappinfoeventlistener applicationinformationeventcallback eventcallback ; since 2 0 it installs a callback that is triggered every time a change occurs on the list of installed applications on a device this change may occur due to a new installation, uninstallation, or update of an application when executed, the implementation must immediately return a listener id that identifies the listener after returning the id, the change detection operation is started asynchronously the applicationinformationeventcallback must be invoked every time a new application is installed, removed, or updated the change detection must continue until the removeappinfoeventlistener method is called with the corresponding listener identifier parameters eventcallback the method to call when a change on the installed applications is made return value long id of the listener that can be used to remove the listener later exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type unknownerror, if it fails to add a listener because of an unknown error code example var appeventcallback = { oninstalled function appinfo { console log 'the application ' + appinfo name + ' is installed' ; }, onupdated function appinfo { console log 'the application ' + appinfo name + ' is updated' ; }, onuninstalled function appid { console log 'the application ' + appid + ' is uninstalled' ; } }; var watchid = tizen application addappinfoeventlistener appeventcallback ; removeappinfoeventlistener removes the listener to stop receiving notifications for changes on the list of installed applications on a device deprecated deprecated since 2 4 instead, you can use tizen package unsetpackageinfoeventlistener void removeappinfoeventlistener long watchid ; since 2 0 parameters watchid an id that identifies the listener exceptions webapiexception with error type notfounderror, if the listener is not found with the specified id with error type unknownerror, if it fails to remove a listener because of an unknown error code example var appeventcallback = { oninstalled function appinfo { console log 'the application ' + appinfo name + ' is installed' ; }, onupdated function appinfo { console log 'the application ' + appinfo name + ' is updated' ; }, onuninstalled function appid { console log 'the application ' + appid + ' is uninstalled' ; } }; var watchid = tizen application addappinfoeventlistener appeventcallback ; tizen application removeappinfoeventlistener watchid ; addappstatuschangelistener adds a listener for receiving any notification for status changes of the installed applications on a device long addappstatuschangelistener statuseventcallback eventcallback, optional applicationid? appid ; since 4 0 parameters eventcallback the method to call when status of the installed applications is changed appid optional nullable the id of the application which status changes should be monitored if the application id is ommitted or it is equal to null, all applications status changes will be monitored return value long listener id that can be used to remove the listener later exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type invalidvalueserror, if the application id parameter is an empty string with error type aborterror, if it fails to add a listener code example function appstatuseventcallback appid, isactive { console log "the application " + appid + " has been " + isactive ? "activated" "deactivated" ; } var watchid = tizen application addappstatuschangelistener appstatuseventcallback ; output example the application testappid has been activated removeappstatuschangelistener removes the listener to stop receiving notifications for status changes of the installed applications on a device void removeappstatuschangelistener long watchid ; since 4 0 parameters watchid an id that identifies the listener exceptions webapiexception with error type aborterror, if it fails to remove listener code example function appstatuseventcallback appid, isactive { console log "the application " + appid + " has been " + isactive ? "activated" "deactivated" ; } try { var watchid = tizen application addappstatuschangelistener appstatuseventcallback ; tizen application removeappstatuschangelistener watchid ; console log "listener with id " + watchid + " has been removed" ; } catch err { console log "exception " + err name ; } output example listener with id 1 has been removed 2 3 applicationusagefilter this interface represents filter for defining period of time, which will be used as a condition in getappsusageinfo method dictionary applicationusagefilter { long? timespan; date? starttime; date? endtime; }; since 4 0 the maximum retention period is 90 days dictionary members long? timespan the attribute to store period of time, from which data is accumulated, in days the period of time begins timespan days ago and ends with current date if the attribute is given, the attributes starttime and endtime of this interface are not taken into an account if timespan is greater than 90, 90 will be used instead since 4 0 date? starttime the attribute to store the date, which is used as a lower bound for selecting data if only starttime attribute is given, by default endtime is equal to the current date if starttime date predates the 90 days from the current time, data will be accumulated from last 90 days since 4 0 date? endtime the attribute to store the date, which is used as an upper bound for selecting data if only endtime attribute is given, data will be accumulated from 90 days ago to endtime date since 4 0 2 4 application this interface defines the current application's information and the basic operations such as exit or hide for the current application [nointerfaceobject] interface application { readonly attribute applicationinformation appinfo; readonly attribute applicationcontextid contextid; void exit raises webapiexception ; void hide raises webapiexception ; requestedapplicationcontrol getrequestedappcontrol raises webapiexception ; long addeventlistener eventinfo event, eventcallback callback raises webapiexception ; void removeeventlistener long watchid raises webapiexception ; void broadcastevent eventinfo event, usereventdata data raises webapiexception ; void broadcasttrustedevent eventinfo event, usereventdata data raises webapiexception ; }; since 2 0 attributes readonly applicationinformation appinfo an attribute to store the application information for the current application since 2 0 readonly applicationcontextid contextid an attribute to store the id of a running application since 2 0 methods exit exits the current application void exit ; since 2 0 remark this method is not supported by web widget exceptions webapiexception with error type unknownerror, if any other error occurs code example var app = tizen application getcurrentapplication ; app exit ; hide hides the current application void hide ; since 2 0 remark this method is not supported by web widget exceptions webapiexception with error type unknownerror, if any other error occurs code example var app = tizen application getcurrentapplication ; app hide ; getrequestedappcontrol gets the requested application control passed to the current application requestedapplicationcontrol getrequestedappcontrol ; since 2 0 gets the requested application control that contains the application control passed by the launchappcontrol method from the calling application the requested application control contains the reason the application is launched and what it has to perform for example, an application might be launched to display an image on a page by another application's request in all of these cases, the application is responsible for checking the contents of the application control and responding appropriately when it is launched remark this method is not supported by web widget return value requestedapplicationcontrol the details of a requested application control exceptions webapiexception with error type unknownerror, if the application control cannot be retrieved because of an unknown error code example var reqappcontrol = tizen application getcurrentapplication getrequestedappcontrol ; if reqappcontrol { console log "requester appid " + reqappcontrol callerappid ; } addeventlistener adds a listener which will invoke a callback function when an event occurs long addeventlistener eventinfo event, eventcallback callback ; since 2 4 system events do not require an application identifier to be specified therefore, the appid attribute of the eventinfo dictionary should not be specified when listening for system events if it is specified, the event to listen for will be interpreted as an user event parameters event event which will invoke the callback callback callback function to be invoked when the event occurs return value long listener identifier exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type with error type unknownerror in any other error case code example var app = tizen application getcurrentapplication ; // for user events sender's application id and event name must be provided by using a dictionary // let's assume that at least two applications are installed function onlistinstalledapps appsinfo { var appid = null; if appsinfo length > 0 && app appinfo id != appsinfo[0] id { appid = appsinfo[0] id; } else if appsinfo length > 1 { appid = appsinfo[1] id; } if appid { var watchid = app addeventlistener {"appid" appid, "name" "custom_user_event"}, function event, data { console log "data " + json stringify data ; // do something } ; } } tizen application getappsinfo onlistinstalledapps ; removeeventlistener removes an event listener with a specified listener identifier void removeeventlistener long watchid ; since 2 4 parameters watchid listener identifier exceptions webapiexception with error type unknownerror in any other error case code example var app = tizen application getcurrentapplication ; // for user events sender's application id and event name must be provided by using a dictionary // let's assume that at least two applications are installed function onlistinstalledapps appsinfo { var appid = null; var watchid = null; if appsinfo length > 0 && app appinfo id != appsinfo[0] id { appid = appsinfo[0] id; } else if appsinfo length > 1 { appid = appsinfo[1] id; } if appid { watchid = app addeventlistener {"appid" appid, "name" "custom_user_event"}, function event, data { if watchid { app removeeventlistener watchid ; watchid = null; } } ; } } tizen application getappsinfo onlistinstalledapps ; broadcastevent broadcasts a user defined event to all the listeners which are listening for this event void broadcastevent eventinfo event, usereventdata data ; since 2 4 an application can listen to events from other applications however, it can only broadcast its own events therefore, the appid attribute of the eventinfo dictionary must be the identifier of the application which calls this method parameters event event to broadcast data user defined event data to broadcast exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type unknownerror in any other error case code example var mycustomdata = { foo 'bar' }; var app = tizen application getcurrentapplication ; app broadcastevent {"name" "custom_user_event"}, mycustomdata ; broadcasttrustedevent broadcasts a user defined event to all the trusted listeners which are listening for this event applications which have the same certificate as the sending application can receive the event void broadcasttrustedevent eventinfo event, usereventdata data ; since 2 4 an application can listen to events from other applications however, it can only broadcast its own events therefore, the appid attribute of the eventinfo dictionary must be the identifier of the application which calls this method parameters event trusted event to broadcast data user defined trusted event data to broadcast exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type unknownerror in any other error case code example var mytrustedcustomdata = { foo 'bar' }; var app = tizen application getcurrentapplication ; app broadcasttrustedevent {"name" "custom_user_event"}, mytrustedcustomdata ; 2 5 applicationinformation this interface defines the general information available to an installed application [nointerfaceobject] interface applicationinformation { readonly attribute applicationid id; readonly attribute domstring name; readonly attribute domstring iconpath; readonly attribute domstring version; readonly attribute boolean show; readonly attribute domstring[] categories; readonly attribute date installdate; readonly attribute long size raises webapiexception ; readonly attribute packageid packageid; }; since 1 0 attributes readonly applicationid id an attribute to store the identifier of an application for application management since 1 0 readonly domstring name an attribute to store the name of an application since 1 0 readonly domstring iconpath an attribute to store the icon path of an application since 1 0 readonly domstring version an attribute to store the version of an application since 1 0 readonly boolean show an attribute that determines whether the application information should be shown such as in menus since 1 0 readonly domstring[] categories an array of attributes to store the categories that the app belongs to since 2 0 readonly date installdate an attribute to store the application install/update time since 2 0 readonly long size an attribute to store the application size installed space since 2 0 privilege level public privilege http //tizen org/privilege/application info exceptions * webapiexception * with error type securityerror, if this attribute is not allowed readonly packageid packageid an attribute to store the package id of an application since 2 1 2 6 applicationcontext this interface defines the information available about a running application [nointerfaceobject] interface applicationcontext { readonly attribute applicationcontextid id; readonly attribute applicationid appid; }; since 1 0 attributes readonly applicationcontextid id an attribute to store the id of a running application since 1 0 readonly applicationid appid an attribute to store the id of an installed application since 1 0 2 7 applicationbatteryusage this interface defines information about battery usage of application [nointerfaceobject] interface applicationbatteryusage { readonly attribute applicationid appid; readonly attribute double batteryusage; }; since 4 0 attributes readonly applicationid avplay an attribute storing id of an application since 4 0 readonly double batteryusage an attribute which stores information about battery usage of an application with applicationid _appid_ battery usage is a ratio of battery consumption of the application with applicationid _appid_ to the total battery consumption of all applications the attribute value scales from 0 to 1, the higher value, the more battery is consumed since 4 0 2 8 applicationusage this interface defines information about usage of application [nointerfaceobject] interface applicationusage { readonly attribute applicationid appid; readonly attribute unsigned long totalcount; readonly attribute unsigned long totalduration; readonly attribute date lasttime; }; since 4 0 attributes readonly applicationid appid an attribute to store the id of an application since 4 0 readonly unsigned long totalcount an attribute to store the total number of times the application was in the foreground since 4 0 readonly unsigned long totalduration an attribute to store the total time of application usage in seconds since 4 0 readonly date long lasttime an attribute to store the last time when the application was used since 4 0 2 9 applicationcontroldata this interface defines a key/value pair used to pass data between applications through the applicationcontrol interface [constructor domstring key, domstring[] value ] interface applicationcontroldata { attribute domstring key; attribute domstring[] value; }; since 2 0 code example var appcontroldata = new tizen applicationcontroldata "image", [imagedata1] ; constructors applicationcontroldata domstring key, domstring[] value ; attributes domstring key an attribute to store the name of a key since 2 0 domstring[] value an attribute to store the value associated with a key since 2 0 2 10 applicationcontrol this interface consists of an operation, uri, mime type, and data it describes an action to be performed by other applications and is passed to launch other applications if the system gets the application control request, it finds the corresponding application to be launched with the delivered application control and launches the selected application [constructor domstring operation, optional domstring? uri, optional domstring? mime, optional domstring? category, optional applicationcontroldata[]? data, optional applicationcontrollaunchmode? launchmode ] interface applicationcontrol { attribute domstring operation; attribute domstring? uri; attribute domstring? mime; attribute domstring? category; attribute applicationcontroldata[] data; attribute applicationcontrollaunchmode launchmode; }; since 2 0 code example var appcontrol = new tizen applicationcontrol "http //tizen org/appcontrol/operation/view", null, "image/jpeg", null, [new tizen applicationcontroldata "images", [imagedata1, imagedata2] ] ; constructors applicationcontrol domstring operation, optional domstring? uri, optional domstring? mime, optional domstring? category, optional applicationcontroldata[]? data, optional applicationcontrollaunchmode? launchmode ; attributes domstring operation an attribute to store the string that defines the action to be performed by an application control since 2 0 domstring uri nullable an attribute to store the uri needed by an application control since 2 0 domstring mime nullable an attribute to store the mime type of content since 2 0 domstring category nullable an attribute to store the category of the application to be launched since 2 0 applicationcontroldata[] data an array of attributes to store the data needed for an application control since 2 0 applicationcontrollaunchmode launchmode an attribute to specify launch mode default application launch mode is _single_ since 2 4 2 11 requestedapplicationcontrol this interface has an application control information requested and passed from another application and is passed to launch other applications the newly launched application can get the requested application control through the getrequestedappcontrol method, and send the results to the calling application through the replyresult method after performing the required action requested by the calling application [nointerfaceobject] interface requestedapplicationcontrol { readonly attribute applicationcontrol appcontrol; readonly attribute applicationid callerappid; void replyresult optional applicationcontroldata[]? data raises webapiexception ; void replyfailure raises webapiexception ; }; since 2 0 attributes readonly applicationcontrol appcontrol an attribute to store the application control object that describes the caller application's request it contains the information that the calling application passed to _launchappcontrol_ since 2 0 readonly applicationid callerappid an attribute to store the caller application's id since 2 1 methods replyresult sends the results to the caller application void replyresult optional applicationcontroldata[]? data ; since 2 0 parameters data optional nullable an array of applicationcontroldata objects exceptions webapiexception with error type typemismatcherror, if any input parameter is not compatible with the expected type for that parameter with error type notfounderror, if the caller app is not alive or there is no response from the caller app with error type unknownerror, if the reply request fails because of an unknown error code example var reqappcontrol = tizen application getcurrentapplication getrequestedappcontrol ; if reqappcontrol { console log "requester appid " + reqappcontrol callerappid ; var appcontrol = reqappcontrol appcontrol; if appcontrol operation == "http //tizen org/appcontrol/operation/pick" { var data = new tizen applicationcontroldata "http //tizen org/appcontrol/data/selected", ["image1 jpg"] ; reqappcontrol replyresult [data] ; } } replyfailure notifies the calling application that the application failed to perform the requested action void replyfailure ; since 2 0 exceptions webapiexception with error type notfounderror, if the caller app is not alive or there is no response from the caller app with error type unknownerror, if the reply request fails because of an unknown error code example var reqappcontrol = tizen application getcurrentapplication getrequestedappcontrol ; if reqappcontrol { console log "requester appid " + reqappcontrol callerappid ; var appcontrol = reqappcontrol appcontrol; if appcontrol operation == "http //tizen org/appcontrol/operation/pick" { reqappcontrol replyfailure ; } } 2 12 applicationcertificate this interface defines the certificate information of an installed application [nointerfaceobject] interface applicationcertificate { readonly attribute domstring type; readonly attribute domstring value; }; since 2 0 attributes readonly domstring type an attribute to store the type of the application certificate since 2 0 readonly domstring value an attribute to store the value of the application certificatesince 2 0 2 13 applicationmetadata this interface defines the meta data of an installed application [nointerfaceobject] interface applicationmetadata { readonly attribute domstring key; readonly attribute domstring value; }; since 2 2 attributes readonly domstring key an attribute to store the key of the application meta data since 2 2 readonly domstring value an attribute to store the value of the application meta data since 2 2 2 14 batteryusageinfoarraysuccesscallback this callback interface specifies a success callback that is invoked when the battery usage per application array is retrieved [callback=functiononly, nointerfaceobject] interface batteryusageinfoarraysuccesscallback { void onsuccess applicationbatteryusage[] batteryinfoarray ; }; since 4 0 this callback interface specifies a success method with an array of applicationbatteryusage objects as an input parameter it is used in applicationmanager getbatteryusageinfo method methods onsuccess called when the asynchronous call completes successfully void onsuccess applicationbatteryusage[] batteryinfoarray ; since 4 0 remark example of usage can be find at getbatteryusageinfo code example parameters batteryinfoarray an array of data containing information about battery usage per application 2 15 appsusageinfoarraysuccesscallback this callback interface specifies a success callback that is invoked when the application usage statistics array is retrieved [callback=functiononly, nointerfaceobject] interface appsusageinfoarraysuccesscallback { void onsuccess applicationusage[] appsinfoarray ; }; since 4 0 this callback interface specifies a success method with an array of applicationusage objects as an input parameter it is used in applicationmanager getappsusageinfo method methods onsuccess called when the asynchronous call completes successfully void onsuccess applicationusage[] appsinfoarray ; since 4 0 remark an example of usage can be find at getappsusageinfo code example parameters appsinfoarray an array of data containing information about usage per application 2 16 applicationinformationarraysuccesscallback this callback interface specifies a success callback that is invoked when the installed application list is retrieved [callback=functiononly, nointerfaceobject] interface applicationinformationarraysuccesscallback { void onsuccess applicationinformation[] informationarray ; }; since 1 0 this callback interface specifies a success method with an array of applicationinformation objects as an input parameter it is used in applicationmanager getappsinfo methods onsuccess called when the asynchronous call completes successfully void onsuccess applicationinformation[] informationarray ; since 1 0 parameters informationarray a list of installed applications code example function onlistinstalledapps applications { for var i = 0; i < applications length; i++ console log "id " + applications[i] id ; } tizen application getappsinfo onlistinstalledapps ; 2 17 findappcontrolsuccesscallback this callback interface specifies a success callback that is invoked when the system has finished searching applications that match a specific application control [callback=functiononly, nointerfaceobject] interface findappcontrolsuccesscallback { void onsuccess applicationinformation[] informationarray, applicationcontrol appcontrol ; }; since 2 0 this callback interface specifies a success method with an array of applicationinformation objects and application control as an input parameter it is used in applicationmanager findappcontrol methods onsuccess called when the asynchronous call completes successfully void onsuccess applicationinformation[] informationarray, applicationcontrol appcontrol ; since 2 0 parameters informationarray a list of installed applications appcontrol the application control that is passed to applicationmanager findappcontrol code example var appcontrol = new tizen applicationcontrol "http //tizen org/appcontrol/operation/pick", null, "image/jpeg", null ; // findappcontrolsuccesscallback instance function successcb appinfos, appcontrol { // appcontrol is same object with the value passed as first parameter to findappcontrol var appcontrolreplycallback = { // callee sent a reply onsuccess function data { for var i = 0; i < data length; i++ { if data[i] key == "http //tizen org/appcontrol/data/selected" { console log 'selected image is ' + data[i] value[0] ; } } }, // callee returned failure onfailure function { console log 'the launch application control failed' ; } } var appid = appinfos[0] id; // select first app's id tizen application launchappcontrol appcontrol, appid, function {console log "launch application control succeed" ; }, function e {console log "launch application control failed reason " + e message ; }, appcontrolreplycallback ; } tizen application findappcontrol appcontrol, successcb ; 2 18 applicationcontextarraysuccesscallback this callback interface specifies a success callback that is invoked when the list of running applications is retrieved [callback=functiononly, nointerfaceobject] interface applicationcontextarraysuccesscallback { void onsuccess applicationcontext[] contexts ; }; since 1 0 this callback interface specifies a success method with an array of applicationcontext objects as an input parameter it is used in applicationmanager getappscontext methods onsuccess called when _applicationmanager getappscontext _ completes successfully void onsuccess applicationcontext[] contexts ; since 1 0 parameters contexts a list of running applications 2 19 applicationcontroldataarrayreplycallback the applicationcontroldataarrayreplycallback callback specifies success callbacks that are invoked as a reply from the requested application control within the application control requester [callback, nointerfaceobject] interface applicationcontroldataarrayreplycallback { void onsuccess optional applicationcontroldata[]? data ; void onfailure ; }; since 2 0 this callback interface specifies two methods onsuccess - invoked if the callee application calls requestedapplicationcontrol replyresult onfailure - invoked if the callee application calls requestedapplicationcontrol replyfailure code example var appcontrol = new tizen applicationcontrol "http //tizen org/appcontrol/operation/pick", null, "image/jpeg", null ; // applicationcontroldataarrayreplycallback instance var appcontrolreplycallback = { // callee sent a reply onsuccess function data { for var i = 0; i < data length; i++ { if data[i] key == "http //tizen org/appcontrol/data/selected" { console log 'selected image is ' + data[i] value[0] ; } } }, // callee returned failure onfailure function { console log 'the launch application control failed' ; } } tizen application launchappcontrol appcontrol, null, function {console log "launch application control succeed" ; }, function e {console log "launch application control failed reason " + e message ; }, appcontrolreplycallback ; methods onsuccess called when the callee application calls requestedapplicationcontrol replyresult void onsuccess optional applicationcontroldata[]? data ; since 2 0 parameters data optional nullable an array of applicationcontroldata objects onfailure called when the callee application calls requestedapplicationcontrol replyfailure void onfailure ; since 2 0 2 16 applicationinformationeventcallback the applicationinformationeventcallback specifies listener for subscribing for notifications of changes in the list of installed applications on a device [callback, nointerfaceobject] interface applicationinformationeventcallback { void oninstalled applicationinformation info ; void onupdated applicationinformation info ; void onuninstalled applicationid id ; }; since 1 0 this callback interface specifies methods that are invoked when an application is installed, updated, or uninstalled code example var appeventcallback = { oninstalled function appinfo { console log 'the application ' + appinfo name + ' is installed' ; }, onupdated function appinfo { console log 'the application ' + appinfo name + ' is updated' ; }, onuninstalled function appid { console log 'the application ' + appid + ' is uninstalled' ; } }; var watchid = tizen application addappinfoeventlistener appeventcallback ; methods oninstalled called when an application is installed void oninstalled applicationinformation info ; since 1 0 parameters info the application information of the installed application onupdated called when an application is updated void onupdated applicationinformation info ; since 1 0 parameters info the application information of the updated application onuninstalled called when an application is uninstalled void onuninstalled applicationid id ; since 1 0 parameters id the id of the uninstalled application 2 20 systemeventdata the systemeventdata interface defines what is retrieved from the event listener [nointerfaceobject] interface systemeventdata { attribute domstring value; attribute domstring type; }; since 2 4 platform modules will be able to broadcast system events in a future tizen release 2 21 eventcallback the eventcallback interface specifies a callback for getting notified when a specified event occurs [callback=functiononly, nointerfaceobject] interface eventcallback { void onevent eventinfo event, eventdata data ; }; since 2 4 methods onevent called when the event occurs void onevent eventinfo event, eventdata data ; since 2 4 parameters event broadcasted event which invokes this callback data broadcasted event data code example var app = tizen application getcurrentapplication ; // for user events sender's application id and event name must be provided by using a dictionary // let's assume that at least two applications are installed function onlistinstalledapps appsinfo { var appid = null; if appsinfo length > 0 && app appinfo id != appsinfo[0] id { appid = appsinfo[0] id; } else if appsinfo length > 1 { appid = appsinfo[1] id; } var eventcb = function event, data { console log "data " + json stringify data ; // do something }; if appid { var watchid = app addeventlistener {"appid" appid, "name" "custom_user_event"}, eventcb ; } } tizen application getappsinfo onlistinstalledapps ; 2 22 statuseventcallback the statuseventcallback interface specifies a callback for getting notified when status of the installed application has been changed [callback=functiononly, nointerfaceobject] interface statuseventcallback { void onchange applicationid appid, boolean isactive ; }; since 4 0 methods onchange called when the status event occurs void onchange applicationid appid, boolean isactive ; since 4 0 example of using can be find at addappstatuschangelistener code example parameters appid id of the application that status has been changed isactive the new status of the application 2 23 eventinfo the eventinfo dictionary identifies an event with information such as event name if it is an user event, the broadasting application's identifier is also specified dictionary eventinfo { applicationid appid; domstring name; }; since 2 4 system events do not require an application identifier to be specified if one is specified, the event will be interpreted as an user event dictionary members applicationid appid the unique identifier of the application which is broadcasting an event an application can listen to events from other applications however, it can only broadcast its own events therefore, when broadcasting an event, this dictionary member must be the identifier of the application which is broadcasting the event system events do not require an application identifier to be specified if one is specified, the event will be interpreted as an user event since 2 4 domstring name name which describes the event must only contain the ascii characters "[a-z][a-z][0-9]_" and may not begin with a digit must be at least 1 byte in length and not exceed the maximum name length of 127 bytes since 2 4 3 related feature you can check if this api is supported with tizen systeminfo getcapability and decide enable/disable codes that need this api to guarantee the running of the application on a device which has battery, declare the following feature requirement in the config file http //tizen org/feature/battery for more information, see application filtering 4 full webidl module application { typedef domstring applicationid; typedef domstring applicationcontextid; typedef object usereventdata; typedef systemeventdata or usereventdata eventdata; enum applicationcontrollaunchmode { "single", "group" }; enum applicationusagemode { "recently", "frequently" }; [nointerfaceobject] interface applicationmanagerobject { readonly attribute applicationmanager application; }; tizen implements applicationmanagerobject; [nointerfaceobject] interface applicationmanager { application getcurrentapplication raises webapiexception ; void kill applicationcontextid contextid, optional successcallback? successcallback, optional errorcallback? errorcallback raises webapiexception ; void findappcontrol applicationcontrol appcontrol, findappcontrolsuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; void getappscontext applicationcontextarraysuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; applicationcontext getappcontext optional applicationcontextid? contextid raises webapiexception ; void getappsinfo applicationinformationarraysuccesscallback successcallback, optional errorcallback? errorcallback raises webapiexception ; applicationinformation getappinfo optional applicationid? id raises webapiexception ; applicationcertificate[] getappcerts optional applicationid? id raises webapiexception ; domstring getappshareduri optional applicationid? id raises webapiexception ; applicationmetadata[] getappmetadata optional applicationid? id raises webapiexception ; void getbatteryusageinfo batteryusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional long? days, optional long? limit raises webapiexception ; void getappsusageinfo appsusageinfoarraysuccesscallback successcallback, optional errorcallback? errorcallback, optional applicationusagemode? mode, optional applicationusagefilter? filter, optional long? limit raises webapiexception ; long addappstatuschangelistener statuseventcallback eventcallback, optional applicationid? appid raises webapiexception ; void removeappstatuschangelistener long watchid raises webapiexception ; }; dictionary applicationusagefilter { long? timespan; date? starttime; date? endtime; }; [nointerfaceobject] interface application { readonly attribute applicationinformation appinfo; readonly attribute applicationcontextid contextid; void exit raises webapiexception ; void hide raises webapiexception ; requestedapplicationcontrol getrequestedappcontrol raises webapiexception ; long addeventlistener eventinfo event, eventcallback callback raises webapiexception ; void removeeventlistener long watchid raises webapiexception ; void broadcastevent eventinfo event, usereventdata data raises webapiexception ; void broadcasttrustedevent eventinfo event, usereventdata data raises webapiexception ; }; [nointerfaceobject] interface applicationinformation { readonly attribute applicationid id; readonly attribute domstring name; readonly attribute domstring iconpath; readonly attribute domstring version; readonly attribute boolean show; readonly attribute domstring[] categories; readonly attribute date installdate; readonly attribute long size raises webapiexception ; readonly attribute packageid packageid; }; [nointerfaceobject] interface applicationcontext { readonly attribute applicationcontextid id; readonly attribute applicationid appid; }; [nointerfaceobject] interface applicationbatteryusage { readonly attribute applicationid appid; readonly attribute double batteryusage; }; [nointerfaceobject] interface applicationusage { readonly attribute applicationid appid; readonly attribute unsigned long totalcount; readonly attribute unsigned long totalduration; readonly attribute date lasttime; }; [constructor domstring key, domstring[] value ] interface applicationcontroldata { attribute domstring key; attribute domstring[] value; }; [constructor domstring operation, optional domstring? uri, optional domstring? mime, optional domstring? category, optional applicationcontroldata[]? data, optional applicationcontrollaunchmode? launchmode ] interface applicationcontrol { attribute domstring operation; attribute domstring? uri; attribute domstring? mime; attribute domstring? category; attribute applicationcontroldata[] data; attribute applicationcontrollaunchmode launchmode; }; [nointerfaceobject] interface requestedapplicationcontrol { readonly attribute applicationcontrol appcontrol; readonly attribute applicationid callerappid; void replyresult optional applicationcontroldata[]? data raises webapiexception ; void replyfailure raises webapiexception ; }; [nointerfaceobject] interface applicationcertificate { readonly attribute domstring type; readonly attribute domstring value; }; [nointerfaceobject] interface applicationmetadata { readonly attribute domstring key; readonly attribute domstring value; }; [callback=functiononly, nointerfaceobject] interface batteryusageinfoarraysuccesscallback { void onsuccess applicationbatteryusage[] batteryinfoarray ; }; [callback=functiononly, nointerfaceobject] interface appsusageinfoarraysuccesscallback { void onsuccess applicationusage[] appsinfoarray ; }; [callback=functiononly, nointerfaceobject] interface applicationinformationarraysuccesscallback { void onsuccess applicationinformation[] informationarray ; }; [callback=functiononly, nointerfaceobject] interface findappcontrolsuccesscallback { void onsuccess applicationinformation[] informationarray, applicationcontrol appcontrol ; }; [callback=functiononly, nointerfaceobject] interface applicationcontextarraysuccesscallback { void onsuccess applicationcontext[] contexts ; }; [callback, nointerfaceobject] interface applicationcontroldataarrayreplycallback { void onsuccess optional applicationcontroldata[]? data ; void onfailure ; }; [callback, nointerfaceobject] interface applicationinformationeventcallback { void oninstalled applicationinformation info ; void onupdated applicationinformation info ; void onuninstalled applicationid id ; }; [nointerfaceobject] interface systemeventdata { attribute domstring value; attribute domstring type; }; [callback=functiononly, nointerfaceobject] interface eventcallback { void onevent eventinfo event, eventdata data ; }; [callback=functiononly, nointerfaceobject] interface statuseventcallback { void onchange applicationid appid, boolean isactive ; }; dictionary eventinfo { applicationid appid; domstring name; }; };
Connect Samsung Developer Conference
webcertification process for hub-connected devices, to get your entire product family certified and promoted to users through a single process, with greater speed and predictability. learn why to partner with us in the new era of works with smartthings, and follow it up with the developer center session to learn how! speakers daniel moneta smartthings back to list
Connect Samsung Developer Conference
webcertification program and major studios, ott service providers and tool makers are already partners of the program and samsung provides them the best hdr content quality. speakers seongnam oh samsung electronics related video video link video link hdr10+ contents generation tools and workflow
Develop Galaxy Watch for Tizen
docsdk tizen studio provides everything you need to develop apps for tizen, including the ide and the sdk tools tizen studio tizen studio tizen extension sdk the extension sdk provides new ide functionalities to request and register certificates, samsung extension api to provide advanced access to the samsung device's platform capabilities, and includes web device api and native api since v1 2 0, in-app purchase api is provided to purchase items and get item list from samsung galaxy apps and remote appcontrol api, which interacts with remote applications installed on the host device tizen extension sdk introduction and installation guide samsung accessory sdk those who develop galaxy watch companion type applications need this sdk accessory sdk allows you to connect galaxy watch devices to host devices with accessory sdk, you can define a new service between the galaxy watch and host device, enabling you to use the various host device functions from the galaxy watch device accessory sdk download accessory sdk overview
Develop Galaxy Watch for Tizen
docset up sdk download the appropriate sdk installer for your os haven’t installed the tizen sdk? download here note the ide installer installs the sdk based on the gui graphic user interface while the cli command line interface installer installs the sdk based on the cli launching the installer ubuntu apply the execute permission through the chmod +x command windows® double-click the installer executable file mac os® double-click the disk image dmg to open then double-click the installer icon sdk installation accept the software license agreement and then set the installation location note if the location path is not empty, you cannot install the sdk to do so, click the location path and change the location to an empty directory once the installation is finished, you can start to develop tizen web applications visual studio tools for tizen this plugin for visual studio includes the tools you need to develop tizen net applications, such as the project wizard, tizen manifest editor, certificate manager and emulator manager further resources find more information on the sdk installation at the following links at tizen docs
Develop Smart TV
sdkcertification support for multiple projects support for wits on the vscode supported platforms wits is supported on 2017 and later model samsung smart tvs open source hosted on github wits source code and documentation are available on github learn more hosted on npm wits is available to install on npm learn more
Preferences Submitted
You have successfully updated your cookie preferences.