HomeScreen GUI Application / HomeScreen Service Guide

Revision: 0.1
Advanced Driver Information Technology

Table of content

Target reader of this document

Application developer whose software uses HomeScreen.


HomeScreen is built with a GUI application created with Qt(referred as HomeScreenGUI), and a service running on afb-daemon (referred as HomeScreenBinder). HomeScreen can start/switch applications run in AGL, also displays information such as onscreen messages.

You can find these projects in AGL gerrit.

homescreen-2017(HomeScreenGUI): agl-service-homescreen-2017(HomeScreenBinder’s binding library): libhomescreen(library for application to communication with HomeScreenBinder):

Also HomeScreenGUI is using libwindowmanager.

Getting Start

Supported environment

Item Description
AGL version Electric Eel
Hardware Renesas R-Car Starter Kit Pro(M3)


Download recipe

$ mkdir WORK
$ cd WORK
$ repo init -u
$ repo sync

Then you can find the following recipes.

  • meta-agl-devel/meta-hmi-framework/homescreen-2017

  • meta-agl-devel/meta-hmi-framework/agl-service-homescreen-2017

  • meta-agl-demo/recipes-demo-hmi/libhomescreen


$ source meta-agl/scripts/ -m m3ulcb agl-demo agl-devel agl-appfw-smack agl-hmi-framework
$ bitbake agl-demo-platform


To use HomeScreen API, an application shall paste the following configuration definition into “config.xml” of application.

<feature name="urn:AGL:widget:required-api">
	<param name="homescreen" value="ws" />

How to call HomeScreen APIs from your Application?

HomeScreen provides a library which is called “libhomescreen”. This library treats “json format” as API calling. For example, if an application wants to call “tap_shortcut()” API, the you should implement as below.

At first the application should create the instance of libhomescreen.

LibHomeScreen* libhs;
libhs = new LibHomeScreen();
libhs->init(port, token);

The port and token is provided by Application Framework

Execute the “tapShortcut()” function.


Regarding the detail of tap_shortcut() API, please refer this section. The first parameter is the name of API, so in this case “tap_shortcut” is proper string. And the second parameter corresponds to arguments of “connect()” API.

See also our Sample code.

Supported usecase

  1. HomeScreenGUI sending ShortCut Icon tapped event to applications
    • Applications using libhomescreen to subscribe the tapShortcut event, HomeScreenGUI will send ShortCut Icon tapped event to applications.
  2. Display OnScreen messages
    • Applications sending OnScreen messages to homescreen-service, and OnScreenAPP will get these message and display.
  3. Get OnSreen Reply event
    • When OnScreen messages is displaying, OnScreenAPP will send a reply event to applications.

Software Architecture

The architecture of HomeScreen is shown below. HomeScreen is the service designed to be used by multiple applications. Therefore HomeScreen framework consists on two binder layers. Please refer the following figure. The upper binder is for application side security context for applications. The lower binder is for servide side security context. Usually application side binder has some business logic for each application, so the number of binders depend on the number of applications which use HomeScreen. On the other hand, regarding lower binder there is only one module in the system. This binder receives all messages from multiple applications (in detail, it comes from upper layer binder).

The communication protocols between libhomescreen and upper binder, upper binder and lower binder, lower binder (homescreen-binding) are WebSocket.


API reference

“libhomescreen” and “agl-service-homescreen-2017” provides several kinds of APIs.

HomeScreen Specific API


Initialize Sequence

initialize-registercallback.svg * deprecated initialize-set-event-handler

Tap Shortcut Sequence


On Screen Message / Reply Sequence


Sample code

You can find sample implementation of HomeScreen as below.

  • libhomescreen/sample/simple-egl

  • libhomescreen/sample/template


title Application initialization phase (ex. registerCallback)
entity App
entity HomeScreenBinder
entity HomeScreenGUI
App->HomeScreenBinder: init(port, token)
App->HomeScreenBinder: subscribe()

note over HomeScreenBinder
    Register the event the App wishes to receive
end note

App->HomeScreenBinder: registerCallback()

title Application initialization phase (ex. set_event_handler)
entity App
entity HomeScreenBinder
entity HomeScreenGUI
App->HomeScreenBinder: init(port, token)
App->HomeScreenBinder: set_event_handler()

note over HomeScreenBinder
    setup event handler the App wishes to receive
end note

title Application Callback Event TapShortcut phase
entity App
entity HomeScreenBinder
entity HomeScreenGUI
App->HomeScreenBinder: set_event_handler()

note over App
end note

HomeScreenGUI->HomeScreenBinder: tapShortcut(application_name)
HomeScreenBinder->App: event_handler(application_name)
title Application Callback Event On Screen Message / Reply phase
entity App
entity HomeScreenBinder
entity HomeScreenGUI

HomeScreenGUI->HomeScreenBinder: set_event_handler()

note over HomeScreenGUI
end note

App->HomeScreenBinder: set_event_handler()

note over App
end note

App->HomeScreenBinder: onScreenMessage(display_message)
HomeScreenBinder->HomeScreenGUI: event_handler(display_message)
HomeScreenGUI->HomeScreenBinder: onScreenReply(reply_message)
HomeScreenBinder->App: event_handler(reply_message)