<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#get">Getting Runtime Information with a Key-Value Pair</a></li>
<li><a href="#get_function">Getting Runtime Information with a Function</a></li>
+ <li><a href="#get_apps">Getting Application Runtime Information</a></li>
<li><a href="#monitor">Monitoring Runtime Information Changes</a></li>
<li><a href="#keys">Runtime Information Keys</a></li>
</ul>
<p>Tizen provides various runtime information and enables your application to access it and monitor changes in it.</p>
<p>The main features of the Runtime Information API include:</p>
<ul>
- <li>Getting runtime information with a key-value pair
+ <li>Getting runtime information with a key-value pair
<p>You can <a href="#get">retrieve a runtime information value</a> using its <a href="#keys">key</a>.</p></li>
<li>Getting runtime information with a function
<p>You can <a href="#get_function">retrieve runtime information using a function</a> specific to a certain information.</p></li>
+ <li>Getting application runtime information
+ <p>You can <a href="#get_apps">retrieve runtime information about running applications</a>.</p></li>
<li>Monitoring runtime information changes
<p>You can <a href="#monitor">register a callback function to monitor specific changes</a> in the runtime information.</p></li>
- </ul>
+ </ul>
<h2 id="prerequisites">Prerequisites</h2>
}
</pre></li></ol>
-
<h2 id="get_function" name="get_function">Getting Runtime Information with a Function</h2>
<p>Some runtime information can be retrieved by using a function.</p>
}
</pre>
+<h2 id="get_apps" name="get_apps">Getting Application Runtime Information</h2>
+
+<p>You can get runtime information on running applications.</p>
+<p>For example, to get the memory usage information for each application:</p>
+
+<pre class="prettyprint">
+void
+print_memory_usage(void)
+{
+ int ret;
+ int i;
+ int count;
+ app_usage_h mem_usage_handle;
+ char *appid;
+ unsigned int usage;
+
+ ret = runtime_info_get_all_apps_memory_usage(&mem_usage_handle);
+ if (ret != RUNTIME_INFO_ERROR_NONE) {
+ /* Error handling */
+ }
+
+ ret = runtime_info_app_usage_get_count(mem_usage_handle, &count);
+ if (ret != RUNTIME_INFO_ERROR_NONE) {
+ /* Error handling */
+ }
+
+ for (i = 0; i < count; i++) {
+ ret = runtime_info_app_usage_get_appid(mem_usage_handle, i, &appid);
+ if (ret != RUNTIME_INFO_ERROR_NONE) {
+ /* Error handling */
+ }
+
+ ret = runtime_info_app_usage_get_usage(mem_usage_handle, i, &usage);
+ if (ret != RUNTIME_INFO_ERROR_NONE) {
+ /* Error handling */
+ }
+
+ dlog_print(DLOG_INFO, LOG_TAG, "appid = %s, usage = %u KB\n", appid, usage);
+ free(appid);
+ }
+
+ ret = runtime_info_app_usage_destroy(mem_usage_handle);
+ if (ret != RUNTIME_INFO_ERROR_NONE) {
+ /* Error handling */
+ }
+}
+</pre>
+
<h2 id="monitor" name="monitor">Monitoring Runtime Information Changes</h2>
<p>Applications can be notified about changes in the runtime information.</p>
</tbody>
</table>
+
<script type="text/javascript" src="../../scripts/jquery.zclip.min.js"></script>
<script type="text/javascript" src="../../scripts/showhide.js"></script>
</div></div></div>
</script>
</body>
-</html>
\ No newline at end of file
+</html>