Provide unit in config.xml and documentation
[src/app-framework-main.git] / docs / quick-tutorial.md
index 081dfe5..c8122d4 100644 (file)
@@ -4,19 +4,21 @@ AGL Application Framework: A Quick Tutorial
 
 Introduction
 ------------
-This document proposes a quick tutorial to demonstrate the major functionnalities of the AGL Application Framework. For more complete information, please refer to the inline documentation available in the main git repository: 
-https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/app-framework-main
-https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/app-framework-binder
+This document proposes a quick tutorial to demonstrate the major functionalities of the AGL Application Framework. For more complete information, please refer to the inline documentation available in the main git repository:
+
+[https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/app-framework-main]
+[https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/app-framework-binder]
+
 
 For more information on AGL, please visit:
-https://www.automotivelinux.org/
+[https://www.automotivelinux.org/]
 
 ----------
 
 Sample applications
 -------------------
 4 sample applications (.wgt files) are prebuilt and available at the following address:
-https://github.com/iotbzh/afm-widget-examples
+[https://github.com/iotbzh/afm-widget-examples]
 
 You can get them by cloning this git repository on your desktop (will be useful later in this tutorial):
 
@@ -29,6 +31,7 @@ Using the CLI tool
 
 ### Setup Environment
 Connect your AGL target board to the network and copy some sample widgets on it through SSH (set BOARDIP with your board IP address) :
+
 ```
 $ cd afm-widget-examples
 $ BOARDIP=1.2.3.4
@@ -47,42 +50,36 @@ We can see that there are two daemons running:
 * **afm-system-daemon** runs with a system user 'afm' and is responsible for installing/uninstalling packages
 * **afm-user-daemon** runs as a user daemon (currently as root because it's the only real user on the target board) and is responsible for the whole lifecycle of the applications running inside the user session.
 
-The application framework has a tool running on the Command Line Interface (CLI). Using the **afm-util** command, you can install, uninstall, list, run, pause ... applications. 
+The application framework has a tool running on the Command Line Interface (CLI). Using the **afm-util** command, you can install, uninstall, list, run, pause ... applications.
 
 To begin, run '**afm-util help**' to get a quick help on commands:
 
     root@porter:~# afm-util help
     usage: afm-util command [arg]
-    
+
     The commands are:
-    
+
       list
       runnables      list the runnable widgets installed
-    
+
       add wgt
       install wgt    install the wgt file
-    
+
       remove id
       uninstall id   remove the installed widget of id
-    
+
       info id
       detail id      print detail about the installed widget of id
-    
+
       ps
       runners        list the running instance
-    
+
       run id
       start id       start an instance of the widget of id
-    
+
       kill rid
       terminate rid  terminate the running instance rid
-    
-      stop rid
-      pause rid      pause the running instance rid
-    
-      resume rid
-      continue rid   resume the previously rid
-    
+
       status rid
       state rid      get status of the running instance rid
 
@@ -90,12 +87,12 @@ To begin, run '**afm-util help**' to get a quick help on commands:
 
 You can then install your first application:
 
-    root@porter:~# afm-util install /home/root/annex.wgt 
+    root@porter:~# afm-util install /home/root/annex.wgt
     { "added": "webapps-annex@0.0" }
 
 Let's install a second application:
 
-    root@porter:~# afm-util install /home/root/memory-match.wgt 
+    root@porter:~# afm-util install /home/root/memory-match.wgt
     { "added": "webapps-memory-match@1.1" }
 
 Note that usually, **afm-util** will return a **JSON result**, which is the common format for messages returned by the Application Framework daemons.
@@ -146,18 +143,6 @@ To check for running applications, just run:
 
 The 'runid' is the application instance ID and is used as an argument for the subcommands controlling the application runtime state (kill/pause/resume/status)
 
-### Pause application
-To pause the application that was just started (the one with RUNID 1), just run the pause command:
-
-    root@porter:~# afm-util terminate 1
-    true
-    
-The application is now paused, as confirmed by a list of running apps:
-
-    root@porter:~# afm-util ps
-    [ ]
-
-
 ### Uninstall application
 To uninstall an application, simply use its ID:
 
@@ -174,7 +159,7 @@ afm-client: a sample HTML5 'Homescreen'
 
 **afm-client** is a HTML5 UI that allows to install/uninstall applications as well as starting/pausing them as already demonstrated with afm-util.
 
-The HTML5 UI is accessible remotely through this URL: 
+The HTML5 UI is accessible remotely through this URL:
 http://[board_ip]:1234/opa?token=132456789
 
 ### Installing an application
@@ -193,10 +178,6 @@ In the toolbar, click on the button representing the Rabbit application. You'll
 
 Click on the 'start' item: the application starts and should be visible as a webview on the target board display. Note that at this point, we could also run the application remotely, that is in the same browser as the Homescreen app. By default, the application framework is configured to run applications 'locally' on the board display.
 
-### Pausing an application
-
-In the Homescreen application, click again on the Rabbit application button, then select 'pause': the application then pauses.
-
 ### Uninstalling an application
 
 From the same popup menu, you can select 'uninstall' to remove the application from the system. As a consequence, the application icon should disappear from the toolbar.
@@ -209,9 +190,14 @@ This is a sample HTML5 application demonstrating various basic capabilities of t
 
 This application is not available as WGT file yet and it should be started manually without any specific security context:
 
-    root@porter:~# /usr/bin/afb-daemon --mode=remote --port=1235 --token='' --sessiondir=/home/root/.afm-daemon --rootdir=/usr/share/agl/afb-client --alias=/icons:/usr/share/afm/icons
+    root@porter:~# /usr/bin/afb-daemon --port=1235 --token='' --sessiondir=/home/root/.afm-daemon --rootdir=/usr/share/agl/afb-client --alias=/icons:/usr/share/afm/icons
 
 Then you can access it from a browser:
 http://[board_ip]:1235/opa/?token=132456789
 
 afb-client is a simple application to demonstrate the built-in capabilities of the binder daemon (handling sessions and security tokens, testing POSTs uploads...) and was used during the application framework development to validate the proposed features.
+
+[https://github.com/iotbzh/afm-widget-examples]: https://github.com/iotbzh/afm-widget-examples
+[https://www.automotivelinux.org/]: https://www.automotivelinux.org/
+[https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/app-framework-binder]: https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/app-framework-binder
+[https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/app-framework-main]: https://gerrit.automotivelinux.org/gerrit/#/admin/projects/src/app-framework-main