[SAMPLE APP][Stream-player] Initialization description added
authorAgnieszka Janowicz <a.janowicz@samsung.com>
Mon, 21 Dec 2015 13:09:02 +0000 (14:09 +0100)
committerMichal Pawluk <m.pawluk@samsung.com>
Mon, 21 Dec 2015 20:03:34 +0000 (21:03 +0100)
Change-Id: I0dd715472558d2690c88fa66e78ac33f23ecc3d3
Signed-off-by: Michal Skorupinski <m.skorupinsk@samsung.com>
Signed-off-by: Agnieszka Janowicz <a.janowicz@samsung.com>
org.tizen.sampledescriptions/html/mobile_n/stream-player-mn.html

index 21f6169..5edb70c 100644 (file)
 </ul>
 
 <!-- ********************************************************************************** -->
+<h3>Application Initialization:</h3>
+<p>The entire application life-cycle is implemented in the main.c file, using the common Tizen application structure:</p>
+
+<pre class="prettyprint">
+&nbsp;&nbsp;&nbsp;int main(int argc, char *argv[])
+&nbsp;&nbsp;&nbsp;{
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int ret = 0;
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ui_app_lifecycle_callback_s event_callback = {0,};
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;app_event_handler_h handlers[5] = {NULL, };
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event_callback.create = __app_create;
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event_callback.terminate = __app_terminate;
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, __ui_app_lang_changed, NULL);
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ret = ui_app_main(argc, argv, &event_callback, NULL);
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Error handling
+&nbsp;&nbsp;&nbsp;}
+</pre>
+
+The Stream-Player application's initialization is done within the <span style="font-family: Courier New,Courier,monospace">__app_create()</span> callback function where the <span style="font-family: Courier New,Courier,monospace">player_model_init()</span> function is responsible for the model's initialization. The <span style="font-family: Courier New,Courier,monospace">view_create_base_gui()</span> function is used to initialize the view module. On the application's termination, the <span style="font-family: Courier New,Courier,monospace">__app_terminate()</span> callback function is invoked, and all resources allocated within the model are freed.
+
+<!-- ********************************************************************************** -->
 
 <script type="text/javascript" src="../scripts/jquery.zclip.min.js"></script>
 <script type="text/javascript" src="../scripts/showhide.js"></script>