This commit adds API Reference only to Mobile/TV profiles.
PS2: Guide reviewed
Change-Id: I9d38794af4d2ea2fc9c8b8a8b84da4edeeef646d
Signed-off-by: Szymon Jastrzebski <s.jastrzebsk@partner.samsung.com>
<p>The application ID can be used to retrieve application information, or to launch an application. The context ID is a unique identifier given by the platform to a running application.</p></li>
<li>Retrieve information about battery usage per application with the <code>getBatteryUsageInfo()</code> method of the <code>ApplicationManager</code> interface <strong>in mobile applications only</strong>.
<p>You can retrieve battery usage information starting from a specific number of days ago, or since the battery was last fully charged. You can also select the number of applications included in the returned <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/application.html#ApplicationBatteryUsage">ApplicationBatteryUsage</a> data array.</p></li>
+ <li>Retrieve information about usage statistics per application with the <code>getAppsUsageInfo()</code> method of the <code>ApplicationManager</code> interface <strong>in mobile applications only</strong>.
+ <p>The statistics include the most frequently or recently used applications. You can retrieve application usage information from a specific time period, or starting from a specific number of days ago. You can also select the number of applications included in the returned <a href="../../../../org.tizen.web.apireference/html/device_api/mobile/tizen/application.html#ApplicationUsage">ApplicationUsage</a> data array.</p></li>
</ul>
<p>Learning how to retrieve information about installed and running applications allows you to manage all the device applications from your application: </p>
tizen.application.getBatteryUsageInfo(successCallback);
</pre>
<p>You can expand the obtained data by calling the <code>getAppInfo()</code> method with the <code>ApplicationId</code> parameter you have received from the returned array.</p></li>
+ <li><p>To retrieve application usage statistics, use the <code>getAppsUsageInfo()</code> method of the <code>ApplicationManager</code> interface. Define the type of statistics (most frequently or recently used applications) in the third parameter.</p>
+ <p>To retrieve the statistics from between specific start and end dates, or for a limited time period starting from a specific number of days ago, set the time filter in the fourth parameter of the method. If you leave the parameter at <code>null</code>, a time period starting from 30 days ago is used.</p>
+<pre class="prettyprint">
+var successCallback = function(appsUsageInfo) {
+ appsUsageInfo.forEach(function(auInfo) {
+ console.log("ApplicationID: " + auInfo.appId + ", count: " + auInfo.totalCount +
+ ", duration: " + auInfo.totalDuration + ", last used at: " + auInfo.lastTime);
+ });
+};
+
+var errorCallback = function(err) {
+ console.error(err);
+}
+
+tizen.application.getAppsUsageInfo(successCallback, errorCallback, "RECENTLY");
+</pre>
+<div class="note">
+ <strong>Note</strong>
+ Statistics are available for the last 90 days. If you set a time filter that starts from more than 90 days ago, only the period that falls within the last 90 days is included in the returned array.
+</div>
+</li>
</ul>
<h2 id="manage" name="manage">Managing Applications</h2>
<li>
1.5. <a href="#ApplicationControlLaunchMode">ApplicationControlLaunchMode</a>
</li>
+<li>
+ 1.6. <a href="#ApplicationUsageMode">ApplicationUsageMode</a>
+</li>
</ul>
</li>
<li>2. <a href="#interfaces-section">Interfaces</a><ul class="toc">
</li>
<li>2.2. <a href="#ApplicationManager">ApplicationManager</a>
</li>
-<li>2.3. <a href="#Application">Application</a>
+<li>2.3. <a href="#ApplicationUsageFilter">ApplicationUsageFilter</a>
+</li>
+<li>2.4. <a href="#Application">Application</a>
+</li>
+<li>2.5. <a href="#ApplicationInformation">ApplicationInformation</a>
+</li>
+<li>2.6. <a href="#ApplicationContext">ApplicationContext</a>
</li>
-<li>2.4. <a href="#ApplicationInformation">ApplicationInformation</a>
+<li>2.7. <a href="#ApplicationBatteryUsage">ApplicationBatteryUsage</a>
</li>
-<li>2.5. <a href="#ApplicationContext">ApplicationContext</a>
+<li>2.8. <a href="#ApplicationUsage">ApplicationUsage</a>
</li>
-<li>2.6. <a href="#ApplicationBatteryUsage">ApplicationBatteryUsage</a>
+<li>2.9. <a href="#ApplicationControlData">ApplicationControlData</a>
</li>
-<li>2.7. <a href="#ApplicationControlData">ApplicationControlData</a>
+<li>2.10. <a href="#ApplicationControl">ApplicationControl</a>
</li>
-<li>2.8. <a href="#ApplicationControl">ApplicationControl</a>
+<li>2.11. <a href="#RequestedApplicationControl">RequestedApplicationControl</a>
</li>
-<li>2.9. <a href="#RequestedApplicationControl">RequestedApplicationControl</a>
+<li>2.12. <a href="#ApplicationCertificate">ApplicationCertificate</a>
</li>
-<li>2.10. <a href="#ApplicationCertificate">ApplicationCertificate</a>
+<li>2.13. <a href="#ApplicationMetaData">ApplicationMetaData</a>
</li>
-<li>2.11. <a href="#ApplicationMetaData">ApplicationMetaData</a>
+<li>2.14. <a href="#BatteryUsageInfoArraySuccessCallback">BatteryUsageInfoArraySuccessCallback</a>
</li>
-<li>2.12. <a href="#BatteryUsageInfoArraySuccessCallback">BatteryUsageInfoArraySuccessCallback</a>
+<li>2.15. <a href="#AppsUsageInfoArraySuccessCallback">AppsUsageInfoArraySuccessCallback</a>
</li>
-<li>2.13. <a href="#ApplicationInformationArraySuccessCallback">ApplicationInformationArraySuccessCallback</a>
+<li>2.16. <a href="#ApplicationInformationArraySuccessCallback">ApplicationInformationArraySuccessCallback</a>
</li>
-<li>2.14. <a href="#FindAppControlSuccessCallback">FindAppControlSuccessCallback</a>
+<li>2.17. <a href="#FindAppControlSuccessCallback">FindAppControlSuccessCallback</a>
</li>
-<li>2.15. <a href="#ApplicationContextArraySuccessCallback">ApplicationContextArraySuccessCallback</a>
+<li>2.18. <a href="#ApplicationContextArraySuccessCallback">ApplicationContextArraySuccessCallback</a>
</li>
-<li>2.16. <a href="#ApplicationControlDataArrayReplyCallback">ApplicationControlDataArrayReplyCallback</a>
+<li>2.19. <a href="#ApplicationControlDataArrayReplyCallback">ApplicationControlDataArrayReplyCallback</a>
</li>
-<li>2.17. <a href="#SystemEventData">SystemEventData</a>
+<li>2.20. <a href="#SystemEventData">SystemEventData</a>
</li>
-<li>2.18. <a href="#EventCallback">EventCallback</a>
+<li>2.21. <a href="#EventCallback">EventCallback</a>
</li>
-<li>2.19. <a href="#StatusEventCallback">StatusEventCallback</a>
+<li>2.22. <a href="#StatusEventCallback">StatusEventCallback</a>
</li>
-<li>2.20. <a href="#EventInfo">EventInfo</a>
+<li>2.23. <a href="#EventInfo">EventInfo</a>
</li>
</ul>
</li>
<div>
<a href="#ApplicationMetaData">ApplicationMetaData</a>[] <a href="#ApplicationManager::getAppMetaData">getAppMetaData</a> (optional <a href="#ApplicationId">ApplicationId</a>? id)</div>
<div>void <a href="#ApplicationManager::getBatteryUsageInfo">getBatteryUsageInfo</a> (<a href="#BatteryUsageInfoArraySuccessCallback">BatteryUsageInfoArraySuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback, optional long? days, optional long? limit)</div>
+<div>void <a href="#ApplicationManager::getAppsUsageInfo">getAppsUsageInfo</a> (<a href="#AppsUsageInfoArraySuccessCallback">AppsUsageInfoArraySuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback, optional <a href="#ApplicationUsageMode">ApplicationUsageMode</a>? mode, optional <a href="#ApplicationUsageFilter">ApplicationUsageFilter</a>? filter, optional long? limit)</div>
<div>long <a href="#ApplicationManager::addAppStatusChangeListener">addAppStatusChangeListener</a> (<a href="#StatusEventCallback">StatusEventCallback</a> eventCallback, optional <a href="#ApplicationId">ApplicationId</a>? appId)</div>
<div>void <a href="#ApplicationManager::removeAppStatusChangeListener">removeAppStatusChangeListener</a> (long watchId)</div>
</td>
</tr>
<tr>
+<td><a href="#ApplicationUsageFilter">ApplicationUsageFilter</a></td>
+<td></td>
+</tr>
+<tr>
<td><a href="#Application">Application</a></td>
<td>
<div>void <a href="#Application::exit">exit</a> ()</div>
<td></td>
</tr>
<tr>
+<td><a href="#ApplicationUsage">ApplicationUsage</a></td>
+<td></td>
+</tr>
+<tr>
<td><a href="#ApplicationControlData">ApplicationControlData</a></td>
<td></td>
</tr>
<td><div>void <a href="#BatteryUsageInfoArraySuccessCallback::onsuccess">onsuccess</a> (<a href="#ApplicationBatteryUsage">ApplicationBatteryUsage</a>[] batteryInfoArray)</div></td>
</tr>
<tr>
+<td><a href="#AppsUsageInfoArraySuccessCallback">AppsUsageInfoArraySuccessCallback</a></td>
+<td><div>void <a href="#AppsUsageInfoArraySuccessCallback::onsuccess">onsuccess</a> (<a href="#ApplicationUsage">ApplicationUsage</a>[] appsInfoArray)</div></td>
+</tr>
+<tr>
<td><a href="#ApplicationInformationArraySuccessCallback">ApplicationInformationArraySuccessCallback</a></td>
<td><div>void <a href="#ApplicationInformationArraySuccessCallback::onsuccess">onsuccess</a> (<a href="#ApplicationInformation">ApplicationInformation</a>[] informationArray)</div></td>
</tr>
</ul>
</div>
</div>
+<div class="enum" id="ApplicationUsageMode">
+<a class="backward-compatibility-anchor" name="::Application::ApplicationUsageMode"></a><h3>1.6. ApplicationUsageMode</h3>
+<div class="brief">
+ Specifies the possible modes of getting statistics of application usage.
+ </div>
+<pre class="webidl prettyprint"> enum ApplicationUsageMode { "RECENTLY", "FREQUENTLY" };</pre>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+Possible types are:
+ </p>
+ <ul>
+ <li>
+RECENTLY - indicates most recently used applications, in a descending order of the application use counts </li>
+ <li>
+FREQUENTLY - indicates most frequently used applications, in a descending order of the application use counts </li>
+ </ul>
+ </div>
+</div>
</div>
<div class="interfaces" id="interfaces-section">
<h2>2. Interfaces</h2>
optional long? days,
optional long? limit) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void getAppsUsageInfo(<a href="#AppsUsageInfoArraySuccessCallback">AppsUsageInfoArraySuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback,
+ optional <a href="#ApplicationUsageMode">ApplicationUsageMode</a>? mode,
+ optional <a href="#ApplicationUsageFilter">ApplicationUsageFilter</a>? filter,
+ optional long? limit) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
long addAppStatusChangeListener(<a href="#StatusEventCallback">StatusEventCallback</a> eventCallback, optional <a href="#ApplicationId">ApplicationId</a>? appId) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void removeAppStatusChangeListener(long watchId) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
</pre>
</div>
</dd>
+<dt class="method" id="ApplicationManager::getAppsUsageInfo">
+<a class="backward-compatibility-anchor" name="::Application::ApplicationManager::getAppsUsageInfo"></a><code><b><span class="methodName">getAppsUsageInfo</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets the usage statistics of applications.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void getAppsUsageInfo(<a href="#AppsUsageInfoArraySuccessCallback">AppsUsageInfoArraySuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback, optional <a href="#ApplicationUsageMode">ApplicationUsageMode</a>? mode, optional <a href="#ApplicationUsageFilter">ApplicationUsageFilter</a>? filter, optional long? limit);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+The method gets the most frequently or recently used applications statistics, depending on parameter <em>mode</em>,
+which meet conditions in <em>filter</em> object.
+Maximum number of retrieved objects can be set in <em>limit</em> parameter.
+ </p>
+ <p>
+Applications which have not been used will not be included in results.
+ </p>
+ <p>
+If an attribute <em>endTime</em> from <em>filter</em> object is less than or equal to <em>startTime</em> date, an empty array will be returned.
+ </p>
+ <p>
+The <em>ErrorCallback</em> method is launched with these error types:
+ </p>
+ <ul>
+ <li>
+AbortError - if any system error occurred. </li>
+ <li>
+InvalidValuesError - if any of the input parameters contains an invalid value. </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/apphistory.read
+ </p>
+<p><span class="remark"> Remark : </span>
+ This method is available only on mobile devices.
+An attempt to call this method on other profile will result in throwing <em>NotSupportedError</em> exception.
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">successCallback</span>:
+ The method to call when the invocation ends successfully.
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ The method to call when an error occurs.
+ </li>
+ <li class="param">
+<span class="name">mode</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ The parameter defines a type of application usage to acquire. By default, it is set to <var>FREQUENTLY</var>.
+ </li>
+ <li class="param">
+<span class="name">filter</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ The filter for selecting period of time, from which data is accumulated.
+By default, this parameter has attribute <em>timeSpan</em> set to <var>30</var> days.
+ </li>
+ <li class="param">
+<span class="name">limit</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ This parameter defines maximum count of objects <em>ApplicationUsage</em> in returned array.
+By default, it is set to <var>10</var>.
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type NotSupportedError, if this feature is not supported.
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> 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);
+ </pre>
+</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> 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)
+ </pre>
+</div>
+</dd>
<dt class="method" id="ApplicationManager::addAppStatusChangeListener">
<a class="backward-compatibility-anchor" name="::Application::ApplicationManager::addAppStatusChangeListener"></a><code><b><span class="methodName">addAppStatusChangeListener</span></b></code>
</dt>
</dl>
</div>
</div>
+<div class="dictionary" id="ApplicationUsageFilter">
+<a class="backward-compatibility-anchor" name="::Application::ApplicationUsageFilter"></a><h3>2.3. ApplicationUsageFilter</h3>
+<div class="brief">
+ This interface represents filter for defining period of time, which will be used as a condition in <em>getAppsUsageInfo</em> method.
+ </div>
+<pre class="webidl prettyprint"> dictionary ApplicationUsageFilter {
+ long? timeSpan;
+ Date? startTime;
+ Date? endTime;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+The maximum retention period is 90 days.
+ </p>
+ </div>
+<div class="attributes">
+<h4>Dictionary members</h4>
+<dl>
+<dt class="member" id="ApplicationUsageFilter::timeSpan"><span class="attrName">long? timeSpan</span></dt>
+<dd>
+<div class="brief">
+ The attribute to store period of time, from which data is accumulated, in days.
+The period of time begins <em>timeSpan</em> days ago and ends with current date.
+ </div>
+<div class="description">
+ <p>
+If the attribute is given, the attributes <em>startTime</em> and <em>endTime</em> of this interface are not taken into an account.
+If <em>timeSpan</em> is greater than <var>90</var>, <var>90</var> will be used instead.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</dd>
+<dt class="member" id="ApplicationUsageFilter::startTime"><span class="attrName">Date? startTime</span></dt>
+<dd>
+<div class="brief">
+ The attribute to store the date, which is used as a lower bound for selecting data.
+ </div>
+<div class="description">
+ <p>
+If only <em>startTime</em> attribute is given, by default <em>endTime</em> is equal to the current date.
+If <em>startTime</em> date predates the 90 days from the current time, data will be accumulated from last 90 days.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</dd>
+<dt class="member" id="ApplicationUsageFilter::endTime"><span class="attrName">Date? endTime</span></dt>
+<dd>
+<div class="brief">
+ The attribute to store the date, which is used as an upper bound for selecting data.
+ </div>
+<div class="description">
+ <p>
+If only <em>endTime</em> attribute is given, data will be accumulated from 90 days ago to <em>endTime</em> date.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</dd>
+</dl>
+</div>
+</div>
<div class="interface" id="Application">
-<a class="backward-compatibility-anchor" name="::Application::Application"></a><h3>2.3. Application</h3>
+<a class="backward-compatibility-anchor" name="::Application::Application"></a><h3>2.4. Application</h3>
<div class="brief">
This interface defines the current application's information and
the basic operations (such as exit or hide) for the current application.
</div>
</div>
<div class="interface" id="ApplicationInformation">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationInformation"></a><h3>2.4. ApplicationInformation</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationInformation"></a><h3>2.5. ApplicationInformation</h3>
<div class="brief">
This interface defines the general information available to an installed application.
</div>
</div>
</div>
<div class="interface" id="ApplicationContext">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationContext"></a><h3>2.5. ApplicationContext</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationContext"></a><h3>2.6. ApplicationContext</h3>
<div class="brief">
This interface defines the information available about a running
application.
</div>
</div>
<div class="interface" id="ApplicationBatteryUsage">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationBatteryUsage"></a><h3>2.6. ApplicationBatteryUsage</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationBatteryUsage"></a><h3>2.7. ApplicationBatteryUsage</h3>
<div class="brief">
This interface defines information about battery usage of application.
</div>
</ul>
</div>
</div>
+<div class="interface" id="ApplicationUsage">
+<a class="backward-compatibility-anchor" name="::Application::ApplicationUsage"></a><h3>2.8. ApplicationUsage</h3>
+<div class="brief">
+ This interface defines information about usage of application.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface ApplicationUsage {
+
+ readonly attribute <a href="#ApplicationId">ApplicationId</a> appId;
+
+ readonly attribute unsigned long totalCount;
+
+ readonly attribute unsigned long totalDuration;
+
+ readonly attribute Date lastTime;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="ApplicationUsage::appId">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">ApplicationId </span><span class="name">appId</span></span><div class="brief">
+ An attribute to store the ID of an application.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+<li class="attribute" id="ApplicationUsage::totalCount">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">unsigned long </span><span class="name">totalCount</span></span><div class="brief">
+ An attribute to store the total number of times the application was in the foreground.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+<li class="attribute" id="ApplicationUsage::totalDuration">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">unsigned long </span><span class="name">totalDuration</span></span><div class="brief">
+ An attribute to store the total time of application usage in seconds.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+<li class="attribute" id="ApplicationUsage::lastTime">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">Date </span><span class="name">lastTime</span></span><div class="brief">
+ An attribute to store the last time when the application was used.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+</ul>
+</div>
+</div>
<div class="interface" id="ApplicationControlData">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationControlData"></a><h3>2.7. ApplicationControlData</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationControlData"></a><h3>2.9. ApplicationControlData</h3>
<div class="brief">
This interface defines a key/value pair used to pass data
between applications through the <em>ApplicationControl </em>interface.
</div>
</div>
<div class="interface" id="ApplicationControl">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationControl"></a><h3>2.8. ApplicationControl</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationControl"></a><h3>2.10. ApplicationControl</h3>
<div class="brief">
This interface consists of an operation, URI, MIME type,
and data. It describes an action to be performed by other applications
</div>
</div>
<div class="interface" id="RequestedApplicationControl">
-<a class="backward-compatibility-anchor" name="::Application::RequestedApplicationControl"></a><h3>2.9. RequestedApplicationControl</h3>
+<a class="backward-compatibility-anchor" name="::Application::RequestedApplicationControl"></a><h3>2.11. RequestedApplicationControl</h3>
<div class="brief">
This interface has an application control information requested and passed
from another application and is passed to launch other applications. The newly
</div>
</div>
<div class="interface" id="ApplicationCertificate">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationCertificate"></a><h3>2.10. ApplicationCertificate</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationCertificate"></a><h3>2.12. ApplicationCertificate</h3>
<div class="brief">
This interface defines the certificate information of an installed application.
</div>
</div>
</div>
<div class="interface" id="ApplicationMetaData">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationMetaData"></a><h3>2.11. ApplicationMetaData</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationMetaData"></a><h3>2.13. ApplicationMetaData</h3>
<div class="brief">
This interface defines the meta data of an installed application
</div>
</div>
</div>
<div class="interface" id="BatteryUsageInfoArraySuccessCallback">
-<a class="backward-compatibility-anchor" name="::Application::BatteryUsageInfoArraySuccessCallback"></a><h3>2.12. BatteryUsageInfoArraySuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::BatteryUsageInfoArraySuccessCallback"></a><h3>2.14. BatteryUsageInfoArraySuccessCallback</h3>
<div class="brief">
This callback interface specifies a success callback that is invoked when the battery usage per application array is retrieved.
</div>
</dl>
</div>
</div>
+<div class="interface" id="AppsUsageInfoArraySuccessCallback">
+<a class="backward-compatibility-anchor" name="::Application::AppsUsageInfoArraySuccessCallback"></a><h3>2.15. AppsUsageInfoArraySuccessCallback</h3>
+<div class="brief">
+ This callback interface specifies a success callback that is invoked when the application usage statistics array is retrieved.
+ </div>
+<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface AppsUsageInfoArraySuccessCallback {
+ void onsuccess(<a href="#ApplicationUsage">ApplicationUsage</a>[] appsInfoArray);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+This callback interface specifies a success method with an array of
+<em>ApplicationUsage</em> objects as an input parameter. It is used in <em>ApplicationManager.getAppsUsageInfo()</em> method.
+ </p>
+ </div>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="AppsUsageInfoArraySuccessCallback::onsuccess">
+<a class="backward-compatibility-anchor" name="::Application::AppsUsageInfoArraySuccessCallback::onsuccess"></a><code><b><span class="methodName">onsuccess</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Called when the asynchronous call completes successfully.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void onsuccess(<a href="#ApplicationUsage">ApplicationUsage</a>[] appsInfoArray);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<p><span class="remark"> Remark : </span>
+ An example of usage can be find at <a href="#ApplicationManager::getAppsUsageInfo">getAppsUsageInfo</a> code example.
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">appsInfoArray</span>:
+ An array of data containing information about usage per application.
+ </li>
+ </ul>
+</div>
+</dd>
+</dl>
+</div>
+</div>
<div class="interface" id="ApplicationInformationArraySuccessCallback">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationInformationArraySuccessCallback"></a><h3>2.13. ApplicationInformationArraySuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationInformationArraySuccessCallback"></a><h3>2.16. ApplicationInformationArraySuccessCallback</h3>
<div class="brief">
This callback interface specifies a success callback that is invoked when the installed application list is retrieved.
</div>
</div>
</div>
<div class="interface" id="FindAppControlSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Application::FindAppControlSuccessCallback"></a><h3>2.14. FindAppControlSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::FindAppControlSuccessCallback"></a><h3>2.17. FindAppControlSuccessCallback</h3>
<div class="brief">
This callback interface specifies a success callback that is invoked when the system has finished searching applications that match a specific application control .
</div>
</div>
</div>
<div class="interface" id="ApplicationContextArraySuccessCallback">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationContextArraySuccessCallback"></a><h3>2.15. ApplicationContextArraySuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationContextArraySuccessCallback"></a><h3>2.18. ApplicationContextArraySuccessCallback</h3>
<div class="brief">
This callback interface specifies a success callback that is invoked when the list of running applications is retrieved.
</div>
</div>
</div>
<div class="interface" id="ApplicationControlDataArrayReplyCallback">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationControlDataArrayReplyCallback"></a><h3>2.16. ApplicationControlDataArrayReplyCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationControlDataArrayReplyCallback"></a><h3>2.19. ApplicationControlDataArrayReplyCallback</h3>
<div class="brief">
The ApplicationControlDataArrayReplyCallback callback specifies success callbacks that are invoked as a reply from the requested application control within the application control requester.
</div>
</div>
</div>
<div class="interface" id="SystemEventData">
-<a class="backward-compatibility-anchor" name="::Application::SystemEventData"></a><h3>2.17. SystemEventData</h3>
+<a class="backward-compatibility-anchor" name="::Application::SystemEventData"></a><h3>2.20. SystemEventData</h3>
<div class="brief">
The SystemEventData interface defines what is retrieved from the event listener.
</div>
</div>
</div>
<div class="interface" id="EventCallback">
-<a class="backward-compatibility-anchor" name="::Application::EventCallback"></a><h3>2.18. EventCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::EventCallback"></a><h3>2.21. EventCallback</h3>
<div class="brief">
The EventCallback interface specifies a callback for getting notified when a specified event occurs.
</div>
</div>
</div>
<div class="interface" id="StatusEventCallback">
-<a class="backward-compatibility-anchor" name="::Application::StatusEventCallback"></a><h3>2.19. StatusEventCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::StatusEventCallback"></a><h3>2.22. StatusEventCallback</h3>
<div class="brief">
The StatusEventCallback interface specifies a callback for getting notified when status of the installed application has been changed.
</div>
</div>
</div>
<div class="dictionary" id="EventInfo">
-<a class="backward-compatibility-anchor" name="::Application::EventInfo"></a><h3>2.20. EventInfo</h3>
+<a class="backward-compatibility-anchor" name="::Application::EventInfo"></a><h3>2.23. EventInfo</h3>
<div class="brief">
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.
</div>
enum ApplicationControlLaunchMode { "SINGLE", "GROUP" };
+ enum ApplicationUsageMode { "RECENTLY", "FREQUENTLY" };
+
[NoInterfaceObject] interface ApplicationManagerObject {
readonly attribute <a href="#ApplicationManager">ApplicationManager</a> application;
};
optional long? days,
optional long? limit) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void getAppsUsageInfo(<a href="#AppsUsageInfoArraySuccessCallback">AppsUsageInfoArraySuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback,
+ optional <a href="#ApplicationUsageMode">ApplicationUsageMode</a>? mode,
+ optional <a href="#ApplicationUsageFilter">ApplicationUsageFilter</a>? filter,
+ optional long? limit) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
long addAppStatusChangeListener(<a href="#StatusEventCallback">StatusEventCallback</a> eventCallback, optional <a href="#ApplicationId">ApplicationId</a>? appId) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void removeAppStatusChangeListener(long watchId) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};
+ dictionary ApplicationUsageFilter {
+ long? timeSpan;
+ Date? startTime;
+ Date? endTime;
+ };
+
[NoInterfaceObject] interface Application {
readonly attribute <a href="#ApplicationInformation">ApplicationInformation</a> appInfo;
readonly attribute double batteryUsage;
};
+ [NoInterfaceObject] interface ApplicationUsage {
+
+ readonly attribute <a href="#ApplicationId">ApplicationId</a> appId;
+
+ readonly attribute unsigned long totalCount;
+
+ readonly attribute unsigned long totalDuration;
+
+ readonly attribute Date lastTime;
+ };
+
[Constructor(DOMString key, DOMString[] value)]
interface ApplicationControlData {
void onsuccess(<a href="#ApplicationBatteryUsage">ApplicationBatteryUsage</a>[] batteryInfoArray);
};
+ [Callback=FunctionOnly, NoInterfaceObject] interface AppsUsageInfoArraySuccessCallback {
+ void onsuccess(<a href="#ApplicationUsage">ApplicationUsage</a>[] appsInfoArray);
+ };
+
[Callback=FunctionOnly, NoInterfaceObject] interface ApplicationInformationArraySuccessCallback {
void onsuccess(<a href="#ApplicationInformation">ApplicationInformation</a>[] informationArray);
};
<li>
1.5. <a href="#ApplicationControlLaunchMode">ApplicationControlLaunchMode</a>
</li>
+<li>
+ 1.6. <a href="#ApplicationUsageMode">ApplicationUsageMode</a>
+</li>
</ul>
</li>
<li>2. <a href="#interfaces-section">Interfaces</a><ul class="toc">
</li>
<li>2.2. <a href="#ApplicationManager">ApplicationManager</a>
</li>
-<li>2.3. <a href="#Application">Application</a>
+<li>2.3. <a href="#ApplicationUsageFilter">ApplicationUsageFilter</a>
+</li>
+<li>2.4. <a href="#Application">Application</a>
+</li>
+<li>2.5. <a href="#ApplicationInformation">ApplicationInformation</a>
+</li>
+<li>2.6. <a href="#ApplicationContext">ApplicationContext</a>
</li>
-<li>2.4. <a href="#ApplicationInformation">ApplicationInformation</a>
+<li>2.7. <a href="#ApplicationBatteryUsage">ApplicationBatteryUsage</a>
</li>
-<li>2.5. <a href="#ApplicationContext">ApplicationContext</a>
+<li>2.8. <a href="#ApplicationUsage">ApplicationUsage</a>
</li>
-<li>2.6. <a href="#ApplicationBatteryUsage">ApplicationBatteryUsage</a>
+<li>2.9. <a href="#ApplicationControlData">ApplicationControlData</a>
</li>
-<li>2.7. <a href="#ApplicationControlData">ApplicationControlData</a>
+<li>2.10. <a href="#ApplicationControl">ApplicationControl</a>
</li>
-<li>2.8. <a href="#ApplicationControl">ApplicationControl</a>
+<li>2.11. <a href="#RequestedApplicationControl">RequestedApplicationControl</a>
</li>
-<li>2.9. <a href="#RequestedApplicationControl">RequestedApplicationControl</a>
+<li>2.12. <a href="#ApplicationCertificate">ApplicationCertificate</a>
</li>
-<li>2.10. <a href="#ApplicationCertificate">ApplicationCertificate</a>
+<li>2.13. <a href="#ApplicationMetaData">ApplicationMetaData</a>
</li>
-<li>2.11. <a href="#ApplicationMetaData">ApplicationMetaData</a>
+<li>2.14. <a href="#BatteryUsageInfoArraySuccessCallback">BatteryUsageInfoArraySuccessCallback</a>
</li>
-<li>2.12. <a href="#BatteryUsageInfoArraySuccessCallback">BatteryUsageInfoArraySuccessCallback</a>
+<li>2.15. <a href="#AppsUsageInfoArraySuccessCallback">AppsUsageInfoArraySuccessCallback</a>
</li>
-<li>2.13. <a href="#ApplicationInformationArraySuccessCallback">ApplicationInformationArraySuccessCallback</a>
+<li>2.16. <a href="#ApplicationInformationArraySuccessCallback">ApplicationInformationArraySuccessCallback</a>
</li>
-<li>2.14. <a href="#FindAppControlSuccessCallback">FindAppControlSuccessCallback</a>
+<li>2.17. <a href="#FindAppControlSuccessCallback">FindAppControlSuccessCallback</a>
</li>
-<li>2.15. <a href="#ApplicationContextArraySuccessCallback">ApplicationContextArraySuccessCallback</a>
+<li>2.18. <a href="#ApplicationContextArraySuccessCallback">ApplicationContextArraySuccessCallback</a>
</li>
-<li>2.16. <a href="#ApplicationControlDataArrayReplyCallback">ApplicationControlDataArrayReplyCallback</a>
+<li>2.19. <a href="#ApplicationControlDataArrayReplyCallback">ApplicationControlDataArrayReplyCallback</a>
</li>
-<li>2.17. <a href="#SystemEventData">SystemEventData</a>
+<li>2.20. <a href="#SystemEventData">SystemEventData</a>
</li>
-<li>2.18. <a href="#EventCallback">EventCallback</a>
+<li>2.21. <a href="#EventCallback">EventCallback</a>
</li>
-<li>2.19. <a href="#StatusEventCallback">StatusEventCallback</a>
+<li>2.22. <a href="#StatusEventCallback">StatusEventCallback</a>
</li>
-<li>2.20. <a href="#EventInfo">EventInfo</a>
+<li>2.23. <a href="#EventInfo">EventInfo</a>
</li>
</ul>
</li>
<div>
<a href="#ApplicationMetaData">ApplicationMetaData</a>[] <a href="#ApplicationManager::getAppMetaData">getAppMetaData</a> (optional <a href="#ApplicationId">ApplicationId</a>? id)</div>
<div>void <a href="#ApplicationManager::getBatteryUsageInfo">getBatteryUsageInfo</a> (<a href="#BatteryUsageInfoArraySuccessCallback">BatteryUsageInfoArraySuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback, optional long? days, optional long? limit)</div>
+<div>void <a href="#ApplicationManager::getAppsUsageInfo">getAppsUsageInfo</a> (<a href="#AppsUsageInfoArraySuccessCallback">AppsUsageInfoArraySuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback, optional <a href="#ApplicationUsageMode">ApplicationUsageMode</a>? mode, optional <a href="#ApplicationUsageFilter">ApplicationUsageFilter</a>? filter, optional long? limit)</div>
<div>long <a href="#ApplicationManager::addAppStatusChangeListener">addAppStatusChangeListener</a> (<a href="#StatusEventCallback">StatusEventCallback</a> eventCallback, optional <a href="#ApplicationId">ApplicationId</a>? appId)</div>
<div>void <a href="#ApplicationManager::removeAppStatusChangeListener">removeAppStatusChangeListener</a> (long watchId)</div>
</td>
</tr>
<tr>
+<td><a href="#ApplicationUsageFilter">ApplicationUsageFilter</a></td>
+<td></td>
+</tr>
+<tr>
<td><a href="#Application">Application</a></td>
<td>
<div>void <a href="#Application::exit">exit</a> ()</div>
<td></td>
</tr>
<tr>
+<td><a href="#ApplicationUsage">ApplicationUsage</a></td>
+<td></td>
+</tr>
+<tr>
<td><a href="#ApplicationControlData">ApplicationControlData</a></td>
<td></td>
</tr>
<td><div>void <a href="#BatteryUsageInfoArraySuccessCallback::onsuccess">onsuccess</a> (<a href="#ApplicationBatteryUsage">ApplicationBatteryUsage</a>[] batteryInfoArray)</div></td>
</tr>
<tr>
+<td><a href="#AppsUsageInfoArraySuccessCallback">AppsUsageInfoArraySuccessCallback</a></td>
+<td><div>void <a href="#AppsUsageInfoArraySuccessCallback::onsuccess">onsuccess</a> (<a href="#ApplicationUsage">ApplicationUsage</a>[] appsInfoArray)</div></td>
+</tr>
+<tr>
<td><a href="#ApplicationInformationArraySuccessCallback">ApplicationInformationArraySuccessCallback</a></td>
<td><div>void <a href="#ApplicationInformationArraySuccessCallback::onsuccess">onsuccess</a> (<a href="#ApplicationInformation">ApplicationInformation</a>[] informationArray)</div></td>
</tr>
</ul>
</div>
</div>
+<div class="enum" id="ApplicationUsageMode">
+<a class="backward-compatibility-anchor" name="::Application::ApplicationUsageMode"></a><h3>1.6. ApplicationUsageMode</h3>
+<div class="brief">
+ Specifies the possible modes of getting statistics of application usage.
+ </div>
+<pre class="webidl prettyprint"> enum ApplicationUsageMode { "RECENTLY", "FREQUENTLY" };</pre>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+Possible types are:
+ </p>
+ <ul>
+ <li>
+RECENTLY - indicates most recently used applications, in a descending order of the application use counts </li>
+ <li>
+FREQUENTLY - indicates most frequently used applications, in a descending order of the application use counts </li>
+ </ul>
+ </div>
+</div>
</div>
<div class="interfaces" id="interfaces-section">
<h2>2. Interfaces</h2>
optional long? days,
optional long? limit) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void getAppsUsageInfo(<a href="#AppsUsageInfoArraySuccessCallback">AppsUsageInfoArraySuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback,
+ optional <a href="#ApplicationUsageMode">ApplicationUsageMode</a>? mode,
+ optional <a href="#ApplicationUsageFilter">ApplicationUsageFilter</a>? filter,
+ optional long? limit) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
long addAppStatusChangeListener(<a href="#StatusEventCallback">StatusEventCallback</a> eventCallback, optional <a href="#ApplicationId">ApplicationId</a>? appId) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void removeAppStatusChangeListener(long watchId) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
</pre>
</div>
</dd>
+<dt class="method" id="ApplicationManager::getAppsUsageInfo">
+<a class="backward-compatibility-anchor" name="::Application::ApplicationManager::getAppsUsageInfo"></a><code><b><span class="methodName">getAppsUsageInfo</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Gets the usage statistics of applications.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void getAppsUsageInfo(<a href="#AppsUsageInfoArraySuccessCallback">AppsUsageInfoArraySuccessCallback</a> successCallback, optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback, optional <a href="#ApplicationUsageMode">ApplicationUsageMode</a>? mode, optional <a href="#ApplicationUsageFilter">ApplicationUsageFilter</a>? filter, optional long? limit);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+The method gets the most frequently or recently used applications statistics, depending on parameter <em>mode</em>,
+which meet conditions in <em>filter</em> object.
+Maximum number of retrieved objects can be set in <em>limit</em> parameter.
+ </p>
+ <p>
+Applications which have not been used will not be included in results.
+ </p>
+ <p>
+If an attribute <em>endTime</em> from <em>filter</em> object is less than or equal to <em>startTime</em> date, an empty array will be returned.
+ </p>
+ <p>
+The <em>ErrorCallback</em> method is launched with these error types:
+ </p>
+ <ul>
+ <li>
+AbortError - if any system error occurred. </li>
+ <li>
+InvalidValuesError - if any of the input parameters contains an invalid value. </li>
+ </ul>
+ </div>
+<p><span class="privilegelevel">
+ Privilege level: </span>
+ public
+ </p>
+<p><span class="privilege">
+ Privilege: </span>
+ http://tizen.org/privilege/apphistory.read
+ </p>
+<p><span class="remark"> Remark : </span>
+ This method is available only on mobile devices.
+An attempt to call this method on other profile will result in throwing <em>NotSupportedError</em> exception.
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">successCallback</span>:
+ The method to call when the invocation ends successfully.
+ </li>
+ <li class="param">
+<span class="name">errorCallback</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ The method to call when an error occurs.
+ </li>
+ <li class="param">
+<span class="name">mode</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ The parameter defines a type of application usage to acquire. By default, it is set to <var>FREQUENTLY</var>.
+ </li>
+ <li class="param">
+<span class="name">filter</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ The filter for selecting period of time, from which data is accumulated.
+By default, this parameter has attribute <em>timeSpan</em> set to <var>30</var> days.
+ </li>
+ <li class="param">
+<span class="name">limit</span><span class="optional"> [optional]</span><span class="optional"> [nullable]</span>:
+ This parameter defines maximum count of objects <em>ApplicationUsage</em> in returned array.
+By default, it is set to <var>10</var>.
+ </li>
+ </ul>
+</div>
+<div class="exceptionlist">
+<p><span class="except">Exceptions:</span></p>
+ <ul class="exception"><li>WebAPIException<ul>
+<li class="list"><p>
+ with error type NotSupportedError, if this feature is not supported.
+ </p></li>
+<li class="list"><p>
+ with error type SecurityError, if the application does not have the privilege to call this method.
+ </p></li>
+<li class="list"><p>
+ with error type TypeMismatchError, if any input parameter is not compatible with the expected type for that parameter.
+ </p></li>
+</ul>
+</li></ul>
+ </div>
+<div class="example">
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> 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);
+ </pre>
+</div>
+<div class="output">
+<span class="title"><p>Output example:</p></span><pre> 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)
+ </pre>
+</div>
+</dd>
<dt class="deprecated method" id="ApplicationManager::addAppInfoEventListener">
<a class="backward-compatibility-anchor" name="::Application::ApplicationManager::addAppInfoEventListener"></a><code><b><span class="methodName">addAppInfoEventListener</span></b></code>
</dt>
</dl>
</div>
</div>
+<div class="dictionary" id="ApplicationUsageFilter">
+<a class="backward-compatibility-anchor" name="::Application::ApplicationUsageFilter"></a><h3>2.3. ApplicationUsageFilter</h3>
+<div class="brief">
+ This interface represents filter for defining period of time, which will be used as a condition in <em>getAppsUsageInfo</em> method.
+ </div>
+<pre class="webidl prettyprint"> dictionary ApplicationUsageFilter {
+ long? timeSpan;
+ Date? startTime;
+ Date? endTime;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+The maximum retention period is 90 days.
+ </p>
+ </div>
+<div class="attributes">
+<h4>Dictionary members</h4>
+<dl>
+<dt class="member" id="ApplicationUsageFilter::timeSpan"><span class="attrName">long? timeSpan</span></dt>
+<dd>
+<div class="brief">
+ The attribute to store period of time, from which data is accumulated, in days.
+The period of time begins <em>timeSpan</em> days ago and ends with current date.
+ </div>
+<div class="description">
+ <p>
+If the attribute is given, the attributes <em>startTime</em> and <em>endTime</em> of this interface are not taken into an account.
+If <em>timeSpan</em> is greater than <var>90</var>, <var>90</var> will be used instead.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</dd>
+<dt class="member" id="ApplicationUsageFilter::startTime"><span class="attrName">Date? startTime</span></dt>
+<dd>
+<div class="brief">
+ The attribute to store the date, which is used as a lower bound for selecting data.
+ </div>
+<div class="description">
+ <p>
+If only <em>startTime</em> attribute is given, by default <em>endTime</em> is equal to the current date.
+If <em>startTime</em> date predates the 90 days from the current time, data will be accumulated from last 90 days.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</dd>
+<dt class="member" id="ApplicationUsageFilter::endTime"><span class="attrName">Date? endTime</span></dt>
+<dd>
+<div class="brief">
+ The attribute to store the date, which is used as an upper bound for selecting data.
+ </div>
+<div class="description">
+ <p>
+If only <em>endTime</em> attribute is given, data will be accumulated from 90 days ago to <em>endTime</em> date.
+ </p>
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</dd>
+</dl>
+</div>
+</div>
<div class="interface" id="Application">
-<a class="backward-compatibility-anchor" name="::Application::Application"></a><h3>2.3. Application</h3>
+<a class="backward-compatibility-anchor" name="::Application::Application"></a><h3>2.4. Application</h3>
<div class="brief">
This interface defines the current application's information and
the basic operations (such as exit or hide) for the current application.
</div>
</div>
<div class="interface" id="ApplicationInformation">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationInformation"></a><h3>2.4. ApplicationInformation</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationInformation"></a><h3>2.5. ApplicationInformation</h3>
<div class="brief">
This interface defines the general information available to an installed application.
</div>
</div>
</div>
<div class="interface" id="ApplicationContext">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationContext"></a><h3>2.5. ApplicationContext</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationContext"></a><h3>2.6. ApplicationContext</h3>
<div class="brief">
This interface defines the information available about a running
application.
</div>
</div>
<div class="interface" id="ApplicationBatteryUsage">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationBatteryUsage"></a><h3>2.6. ApplicationBatteryUsage</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationBatteryUsage"></a><h3>2.7. ApplicationBatteryUsage</h3>
<div class="brief">
This interface defines information about battery usage of application.
</div>
</ul>
</div>
</div>
+<div class="interface" id="ApplicationUsage">
+<a class="backward-compatibility-anchor" name="::Application::ApplicationUsage"></a><h3>2.8. ApplicationUsage</h3>
+<div class="brief">
+ This interface defines information about usage of application.
+ </div>
+<pre class="webidl prettyprint"> [NoInterfaceObject] interface ApplicationUsage {
+
+ readonly attribute <a href="#ApplicationId">ApplicationId</a> appId;
+
+ readonly attribute unsigned long totalCount;
+
+ readonly attribute unsigned long totalDuration;
+
+ readonly attribute Date lastTime;
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="attributes">
+<h4>Attributes</h4>
+<ul>
+<li class="attribute" id="ApplicationUsage::appId">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">ApplicationId </span><span class="name">appId</span></span><div class="brief">
+ An attribute to store the ID of an application.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+<li class="attribute" id="ApplicationUsage::totalCount">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">unsigned long </span><span class="name">totalCount</span></span><div class="brief">
+ An attribute to store the total number of times the application was in the foreground.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+<li class="attribute" id="ApplicationUsage::totalDuration">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">unsigned long </span><span class="name">totalDuration</span></span><div class="brief">
+ An attribute to store the total time of application usage in seconds.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+<li class="attribute" id="ApplicationUsage::lastTime">
+<span class="attrName"><span class="readonly"> readonly
+</span><span class="type">Date </span><span class="name">lastTime</span></span><div class="brief">
+ An attribute to store the last time when the application was used.
+ </div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+</li>
+</ul>
+</div>
+</div>
<div class="interface" id="ApplicationControlData">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationControlData"></a><h3>2.7. ApplicationControlData</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationControlData"></a><h3>2.9. ApplicationControlData</h3>
<div class="brief">
This interface defines a key/value pair used to pass data
between applications through the <em>ApplicationControl </em>interface.
2.0
</p>
<div class="example">
-<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint">
-var appControlData = new tizen.ApplicationControlData("image", [imagedata1]);
-</pre>
+<span class="example"><p>Code example:</p></span><pre name="code" class="examplecode prettyprint"> var appControlData = new tizen.ApplicationControlData("image", [imagedata1]);
+ </pre>
</div>
<div class="constructors">
<h4 id="ApplicationControlData::constructor">Constructors</h4>
</div>
</div>
<div class="interface" id="ApplicationControl">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationControl"></a><h3>2.8. ApplicationControl</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationControl"></a><h3>2.10. ApplicationControl</h3>
<div class="brief">
This interface consists of an operation, URI, MIME type,
and data. It describes an action to be performed by other applications
</div>
</div>
<div class="interface" id="RequestedApplicationControl">
-<a class="backward-compatibility-anchor" name="::Application::RequestedApplicationControl"></a><h3>2.9. RequestedApplicationControl</h3>
+<a class="backward-compatibility-anchor" name="::Application::RequestedApplicationControl"></a><h3>2.11. RequestedApplicationControl</h3>
<div class="brief">
This interface has an application control information requested and passed
from another application and is passed to launch other applications. The newly
</div>
</div>
<div class="interface" id="ApplicationCertificate">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationCertificate"></a><h3>2.10. ApplicationCertificate</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationCertificate"></a><h3>2.12. ApplicationCertificate</h3>
<div class="brief">
This interface defines the certificate information of an installed application.
</div>
</div>
</div>
<div class="interface" id="ApplicationMetaData">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationMetaData"></a><h3>2.11. ApplicationMetaData</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationMetaData"></a><h3>2.13. ApplicationMetaData</h3>
<div class="brief">
This interface defines the meta data of an installed application
</div>
</div>
</div>
<div class="interface" id="BatteryUsageInfoArraySuccessCallback">
-<a class="backward-compatibility-anchor" name="::Application::BatteryUsageInfoArraySuccessCallback"></a><h3>2.12. BatteryUsageInfoArraySuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::BatteryUsageInfoArraySuccessCallback"></a><h3>2.14. BatteryUsageInfoArraySuccessCallback</h3>
<div class="brief">
This callback interface specifies a success callback that is invoked when the battery usage per application array is retrieved.
</div>
</dl>
</div>
</div>
+<div class="interface" id="AppsUsageInfoArraySuccessCallback">
+<a class="backward-compatibility-anchor" name="::Application::AppsUsageInfoArraySuccessCallback"></a><h3>2.15. AppsUsageInfoArraySuccessCallback</h3>
+<div class="brief">
+ This callback interface specifies a success callback that is invoked when the application usage statistics array is retrieved.
+ </div>
+<pre class="webidl prettyprint"> [Callback=FunctionOnly, NoInterfaceObject] interface AppsUsageInfoArraySuccessCallback {
+ void onsuccess(<a href="#ApplicationUsage">ApplicationUsage</a>[] appsInfoArray);
+ };</pre>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<div class="description">
+ <p>
+This callback interface specifies a success method with an array of
+<em>ApplicationUsage</em> objects as an input parameter. It is used in <em>ApplicationManager.getAppsUsageInfo()</em> method.
+ </p>
+ </div>
+<div class="methods">
+<h4>Methods</h4>
+<dl>
+<dt class="method" id="AppsUsageInfoArraySuccessCallback::onsuccess">
+<a class="backward-compatibility-anchor" name="::Application::AppsUsageInfoArraySuccessCallback::onsuccess"></a><code><b><span class="methodName">onsuccess</span></b></code>
+</dt>
+<dd>
+<div class="brief">
+ Called when the asynchronous call completes successfully.
+ </div>
+<div class="synopsis"><pre class="signature prettyprint">void onsuccess(<a href="#ApplicationUsage">ApplicationUsage</a>[] appsInfoArray);
+ </pre></div>
+<p><span class="version">
+ Since: </span>
+ 4.0
+ </p>
+<p><span class="remark"> Remark : </span>
+ An example of usage can be find at <a href="#ApplicationManager::getAppsUsageInfo">getAppsUsageInfo</a> code example.
+ </p>
+<div class="parameters">
+<p><span class="param">Parameters:</span></p>
+<ul>
+ <li class="param">
+<span class="name">appsInfoArray</span>:
+ An array of data containing information about usage per application.
+ </li>
+ </ul>
+</div>
+</dd>
+</dl>
+</div>
+</div>
<div class="interface" id="ApplicationInformationArraySuccessCallback">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationInformationArraySuccessCallback"></a><h3>2.13. ApplicationInformationArraySuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationInformationArraySuccessCallback"></a><h3>2.16. ApplicationInformationArraySuccessCallback</h3>
<div class="brief">
This callback interface specifies a success callback that is invoked when the installed application list is retrieved.
</div>
</div>
</div>
<div class="interface" id="FindAppControlSuccessCallback">
-<a class="backward-compatibility-anchor" name="::Application::FindAppControlSuccessCallback"></a><h3>2.14. FindAppControlSuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::FindAppControlSuccessCallback"></a><h3>2.17. FindAppControlSuccessCallback</h3>
<div class="brief">
This callback interface specifies a success callback that is invoked when the system has finished searching applications that match a specific application control .
</div>
</div>
</div>
<div class="interface" id="ApplicationContextArraySuccessCallback">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationContextArraySuccessCallback"></a><h3>2.15. ApplicationContextArraySuccessCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationContextArraySuccessCallback"></a><h3>2.18. ApplicationContextArraySuccessCallback</h3>
<div class="brief">
This callback interface specifies a success callback that is invoked when the list of running applications is retrieved.
</div>
</div>
</div>
<div class="interface" id="ApplicationControlDataArrayReplyCallback">
-<a class="backward-compatibility-anchor" name="::Application::ApplicationControlDataArrayReplyCallback"></a><h3>2.16. ApplicationControlDataArrayReplyCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::ApplicationControlDataArrayReplyCallback"></a><h3>2.19. ApplicationControlDataArrayReplyCallback</h3>
<div class="brief">
The ApplicationControlDataArrayReplyCallback callback specifies success callbacks that are invoked as a reply from the requested application control within the application control requester.
</div>
</div>
</div>
<div class="interface" id="SystemEventData">
-<a class="backward-compatibility-anchor" name="::Application::SystemEventData"></a><h3>2.17. SystemEventData</h3>
+<a class="backward-compatibility-anchor" name="::Application::SystemEventData"></a><h3>2.20. SystemEventData</h3>
<div class="brief">
The SystemEventData interface defines what is retrieved from the event listener.
</div>
</div>
</div>
<div class="interface" id="EventCallback">
-<a class="backward-compatibility-anchor" name="::Application::EventCallback"></a><h3>2.18. EventCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::EventCallback"></a><h3>2.21. EventCallback</h3>
<div class="brief">
The EventCallback interface specifies a callback for getting notified when a specified event occurs.
</div>
</div>
</div>
<div class="interface" id="StatusEventCallback">
-<a class="backward-compatibility-anchor" name="::Application::StatusEventCallback"></a><h3>2.19. StatusEventCallback</h3>
+<a class="backward-compatibility-anchor" name="::Application::StatusEventCallback"></a><h3>2.22. StatusEventCallback</h3>
<div class="brief">
The StatusEventCallback interface specifies a callback for getting notified when status of the installed application has been changed.
</div>
</div>
</div>
<div class="dictionary" id="EventInfo">
-<a class="backward-compatibility-anchor" name="::Application::EventInfo"></a><h3>2.20. EventInfo</h3>
+<a class="backward-compatibility-anchor" name="::Application::EventInfo"></a><h3>2.23. EventInfo</h3>
<div class="brief">
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.
</div>
enum ApplicationControlLaunchMode { "SINGLE", "GROUP" };
+ enum ApplicationUsageMode { "RECENTLY", "FREQUENTLY" };
+
[NoInterfaceObject] interface ApplicationManagerObject {
readonly attribute <a href="#ApplicationManager">ApplicationManager</a> application;
};
optional long? days,
optional long? limit) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+ void getAppsUsageInfo(<a href="#AppsUsageInfoArraySuccessCallback">AppsUsageInfoArraySuccessCallback</a> successCallback,
+ optional <a href="tizen.html#ErrorCallback">ErrorCallback</a>? errorCallback,
+ optional <a href="#ApplicationUsageMode">ApplicationUsageMode</a>? mode,
+ optional <a href="#ApplicationUsageFilter">ApplicationUsageFilter</a>? filter,
+ optional long? limit) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
+
long addAppStatusChangeListener(<a href="#StatusEventCallback">StatusEventCallback</a> eventCallback, optional <a href="#ApplicationId">ApplicationId</a>? appId) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
void removeAppStatusChangeListener(long watchId) raises(<a href="tizen.html#WebAPIException">WebAPIException</a>);
};
+ dictionary ApplicationUsageFilter {
+ long? timeSpan;
+ Date? startTime;
+ Date? endTime;
+ };
+
[NoInterfaceObject] interface Application {
readonly attribute <a href="#ApplicationInformation">ApplicationInformation</a> appInfo;
readonly attribute double batteryUsage;
};
+ [NoInterfaceObject] interface ApplicationUsage {
+
+ readonly attribute <a href="#ApplicationId">ApplicationId</a> appId;
+
+ readonly attribute unsigned long totalCount;
+
+ readonly attribute unsigned long totalDuration;
+
+ readonly attribute Date lastTime;
+ };
+
[Constructor(DOMString key, DOMString[] value)]
interface ApplicationControlData {
void onsuccess(<a href="#ApplicationBatteryUsage">ApplicationBatteryUsage</a>[] batteryInfoArray);
};
+ [Callback=FunctionOnly, NoInterfaceObject] interface AppsUsageInfoArraySuccessCallback {
+ void onsuccess(<a href="#ApplicationUsage">ApplicationUsage</a>[] appsInfoArray);
+ };
+
[Callback=FunctionOnly, NoInterfaceObject] interface ApplicationInformationArraySuccessCallback {
void onsuccess(<a href="#ApplicationInformation">ApplicationInformation</a>[] informationArray);
};