Zebra SB1 and SB1-HC Smart Badge SB1 Programmer's Guide

SB1
PROGRAMMER’S GUIDE
SB1 PROGRAMMERS GUIDE
72E-170991-03
Rev. A
February 2015
ii SB1 Programmer’s Guide
No part of this publication may be reproduced or used in any form, or by any electrical or mechanical means, without permission in writing from Zebra. This includes electronic or mechanical means, such as photocopying, recording, or information storage and retrieval systems. The material in this ma nual is subject to change without notice.
The software is provided strictly on an “as i s” basis. All sof twar e, including firmware, furnished to the user is on a licensed basis. Zebra grants to the user a non-transferable and non-exclusive license to use each software and firmware program delivered hereunder (licensed program). Except as noted below, such license may not be assigned, sublicensed, or otherwise transferred by the user without prior written consent of Zebra. No right to copy a licensed program in whole or in part is granted, except as permitted under copyright law. The user shall not modify, merge, or incorporate any form or portion of a licensed program with other program material, create a derivative work from a licensed program, or use a licensed program in a network without written permission from Zebra. The user agrees to maintain Zebras copyri ght notice on the licensed programs delivered hereunder, and to include the same on any authorized copies it makes, in whole or in part. The user agrees not to decompile, disassemble, decode, or reverse engineer any licensed program delivered to the user or any portion thereof.
Zebra reserves the right to make changes to any software or product to improve reliability, function, or design. Zebra does not assume any product liability arising out of, or in connection with, the application or use of any
product, circuit, or application described herein. No license is granted, either expressly or by implication, estoppel, or otherwise under any ZebraTechnologies
Corporation, intellectual property rights. An implied license only exists for equipment, circuits, and subsystems contained in Zebra products.

Revision History

Changes to the original guide are listed below:
Change Date Description
-01 Rev. A 1/10/2013 Initial release.
-02 Rev A 7/15/2014 Add description for Wait/Quit behavior.
-03 Rev A 2/28/2015 SB1 RevC Features
Add description for hour glass. Add details for additional configura Add keyboard APIs an Rev B.5 changes.
d samples.
iii
tions introduced in config.js.
iv SB1 Programmer’s Guide

TABLE OF CONTENTS

Revision History.............................................................................................................................. iii
Introduction..................................................................................................................................... xxxv
Documentation Set ................................................................................................................... xxxv
Chapter Descriptions ...................................................................................................................... xxxv
Notational Conventions................................................................................................................... xxxvi
Related Documents and Software.................................................................................................. xxxvi
Chapter 1: Introduction
SB1 System Applications/Shell UI Services .................................................................................. 1-1
Namespaces .................................................................................................................................. 1-3
SB1 Client Applications ............................................................................................................ 1-4
Backend ............................................................................................................................. 1-4
Frontend ............................................................................................................................. 1-4
CSS .................................................................................................................................... 1-4
JavaScript .......................................................................................................................... 1-4
Quick Start Guide ........................................................................................................................... 1-4
Develop First SB1 Application ................................................................................................. 1-4
Add Hello SB1 App in apps.json .............................................................................................. 1-6
Deploy the Hello Application .......................................................................................................... 1-6
Manual Deployment ................................................................................................................. 1-6
Deployment using RDT Solo for Many Devices ............................................................................. 1-7
Chapter 2: Application Integration
Integration with SB1 Shell .............................................................................................................. 2-1
System Integration ................................................................................................................... 2-1
Visual Integration ..................................................................................................................... 2-2
Installation ...................................................................................................................................... 2-2
config.js File ............................................................................................................................. 2-3
apps.json File ........................................................................................................................... 2-3
Remote apps.json file ......................................................................................................... 2-5
Starting Applications .......................................................................................................... 2-5
Developer Content ................................................................................................................... 2-6
ii SB1 Programmer’s Guide
Application Timeout ................................................................................................................. 2-7
Upgrade from Older Versions ........................................................................................................ 2-8
Chapter 3: Application Shared Library
Application System Variables ............................................................................................ 3-1
Application Services ...................................................................................................................... 3-2
Running an Application ............................................................................................................ 3-2
Anonymous: asl.run(appUrl, data, callback); ..................................................................... 3-3
asl.exit(data); ..................................................................................................................... 3-4
asl. close (appName); ........................................................................................................ 3-5
asl. closeChildApp (data); .................................................................................................. 3-5
asl. closeAll (); .................................................................................................................... 3-5
asl. apps (list, append); ...................................................................................................... 3-6
asl. getUserData (); ............................................................................................................ 3-6
asl.minimize(); .................................................................................................................... 3-7
asl. fullscreen (); ................................................................................................................. 3-7
asl.reboot(); ........................................................................................................................ 3-7
asl. enableTouch (); ........................................................................................................... 3-7
asl. disableTouch (); ........................................................................................................... 3-8
Events ...................................................................................................................................... 3-8
asl.events.fire(eventName, data) ....................................................................................... 3-8
asl.events.subscribe(eventName, callback) ....................................................................... 3-8
asl.events.unbsubscribe(eventName) ................................................................................ 3-9
Native Shell Events ............................................................................................................ 3-9
Notification Services ...................................................................................................................... 3-10
Parameters .............................................................................................................................. 3-10
asl. clearNotification (all, type); .......................................................................................... 3-12
Keyboard Services ......................................................................................................................... 3-13
Explicit Keyboard Execution .................................................................................................... 3-13
Keyboard Events ................................................................................................................ 3-14
Shared UI Services ........................................................................................................................ 3-18
Back Button .............................................................................................................................. 3-18
Parameters ........................................................................................................................ 3-18
Title Label ................................................................................................................................ 3-19
Options Menu Button ............................................................................................................... 3-19
Parameters ........................................................................................................................ 3-21
Full Screen Mode ..................................................................................................................... 3-21
Resource Services ......................................................................................................................... 3-23
NPAPI ...................................................................................................................................... 3-23
Messaging Services ....................................................................................................................... 3-26
Authentication Services ................................................................................................................. 3-27
User Profiles and Authentication .............................................................................................. 3-27
Shell Authentication ................................................................................................................. 3-27
Parameters ........................................................................................................................ 3-28
Shell Authentication Properties .......................................................................................... 3-28
asl. signOut() ...................................................................................................................... 3-29
Application Authentication ........................................................................................................ 3-29
Badge Mode ....................................................................................................................... 3-29
asl.lock(url); ........................................................................................................................ 3-30
Setting User Profile from an Application ............................................................................ 3-30
Table of Contents iii
Window Services ........................................................................................................................... 3-31
Alert Window ............................................................................................................................ 3-31
Confirm Window ....................................................................................................................... 3-31
Hourglass ................................................................................................................................. 3-31
Wait/Quit Feature ..................................................................................................................... 3-31
Startup Applications ................................................................................................................. 3-32
Ghosting ................................................................................................................................... 3-32
Cradle Insert and Removal Enhancements ............................................................................. 3-32
QWERTY Keyboard ................................................................................................................. 3-32
Process Application ................................................................................................................. 3-33
Chapter 4: Configuration
ScanTo Application ........................................................................................................................ 4-1
Maximum Number of Running Applications ................................................................................... 4-3
Application Source File Location .................................................................................................... 4-3
Push Notifications Port Number ..................................................................................................... 4-3
Push Notifications Pass Key .......................................................................................................... 4-3
Home Screen Shortcut Buttons ..................................................................................................... 4-4
Home Screen Refresh ................................................................................................................... 4-4
PIN Lock Require ........................................................................................................................... 4-4
Default Lock Screen Page ............................................................................................................. 4-4
Default Badge Screen Page .......................................................................................................... 4-5
Lock Screen Timeout ..................................................................................................................... 4-5
Rotate Badge Screen Timeout ....................................................................................................... 4-6
Disable Profile Button .................................................................................................................... 4-6
Default User Information ................................................................................................................ 4-6
Login Screen Require .................................................................................................................... 4-7
Login Screen URL .......................................................................................................................... 4-7
Logoff URL ..................................................................................................................................... 4-7
Login Timeout ................................................................................................................................ 4-8
Admin Settings PIN Require .......................................................................................................... 4-8
Admin PIN value ............................................................................................................................ 4-8
More Settings Menu Item PIN Require .......................................................................................... 4-8
More Settings PIN Value ................................................................................................................ 4-8
Beeper Duration ............................................................................................................................. 4-8
Beeper Frequency ......................................................................................................................... 4-9
Date Format ................................................................................................................................... 4-9
Time Format ................................................................................................................................... 4-9
Cradle Insert URL .......................................................................................................................... 4-9
Cradle Remove Application ........................................................................................................... 4-9
Process Type Application .............................................................................................................. 4-9
Low Battery URL ............................................................................................................................ 4-10
Manage LED in Shell ..................................................................................................................... 4-10
Beeper for Application Notifications ............................................................................................... 4-10
Beeper for System Notifications ..................................................................................................... 4-10
Beeper for Server Notifications ...................................................................................................... 4-10
Scanner Persist Across Pages ...................................................................................................... 4-10
Number of Waits ............................................................................................................................ 4-11
Wait for Response Timeout ........................................................................................................... 4-11
Clear Local Storage on Reboot ...................................................................................................... 4-11
iv SB1 Programmer’s Guide
Scanner Configuration for the scanTo Application ........................................................................ 4-11
Push Notifications Number of Parameters ..................................................................................... 4-12
Startup Application ......................................................................................................................... 4-12
Start Process Application ............................................................................................................... 4-12
Cradle Insert Activities ................................................................................................................... 4-13
Keyboard Configurations ............................................................................................................... 4-14
Other Configurations ................................................................................................................ 4-14
Chapter 5: Localization
String Resource Files ............................................................................................................... 5-2
Keyboard Resource Files ......................................................................................................... 5-2
Client Application Localization ................................................................................................. 5-2
Chapter 6: Additional Notes
Chapter 7: App Development and Deployment Guidelines
Application Naming ........................................................................................................................ 7-1
Content File Naming ...................................................................................................................... 7-2
Content File Location in SB1 ......................................................................................................... 7-2
Content File Location in Development Workstation ....................................................................... 7-3
Applications Versions .................................................................................................................... 7-4
Memory Considerations ................................................................................................................. 7-7
SB1 Baseline Files and Baseline State ......................................................................................... 7-7
Creating an SB1 Baseline ........................................................................................................ 7-8
Building an SB1 Baseline Package .......................................................................................... 7-9
Deploying an SB1 Baseline Package ...................................................................................... 7-9
Removing an SB1 Baseline Package ...................................................................................... 7-10
Developing and Testing an SB1 Application .................................................................................. 7-10
Building an SB1 Application Package ...................................................................................... 7-11
Deploying an SB1 Application Package ................................................................................... 7-13
Removing an SB1 Application Package .................................................................................. 7-13
Chapter 8: Using Fonts on the SB1
Introduction .................................................................................................................................... 8-1
RhoElements Font System ............................................................................................................ 8-1
Utilizing Current Fonts ................................................................................................................... 8-1
Utilizing New Fonts ........................................................................................................................ 8-2
Installing A New Font To a Local File System ......................................................................... 8-2
Font-Face/Webfonts ................................................................................................................ 8-2
Transferring Fonts ......................................................................................................................... 8-3
Font Licenses ................................................................................................................................ 8-3
Chapter 9: Running off-line Web Applications
Introduction .................................................................................................................................... 9-1
How to Deploy a Web Application ............................................................................................ 9-1
Enabling the Cache Manifest in HTML .......................................................................................... 9-1
Table of Contents v
Cache Manifest .............................................................................................................................. 9-2
Structure .................................................................................................................................. 9-2
Header ............................................................................................................................... 9-2
Cache ................................................................................................................................. 9-2
Network .............................................................................................................................. 9-2
Fallback .............................................................................................................................. 9-2
Server ...................................................................................................................................... 9-3
Tips ................................................................................................................................................ 9-3
Revising the Cache Manifest ................................................................................................... 9-3
Off-line Mode ................................................................................................................................. 9-4
Discerning Connection Status .................................................................................................. 9-4
Network Module ................................................................................................................. 9-4
WEBSQL .................................................................................................................................. 9-5
Example of Using WEBSQL in RhoElements .......................................................................... 9-5
More Information ............................................................................................................................ 9-5
SB1 smart badge - Best Practices & User Training ....................................................................... 9-6
Scanning Recommendations ................................................................................................... 9-6
Overall Usability ....................................................................................................................... 9-6
SB1 Accessories ...................................................................................................................... 9-7
Network Connectivity and Coverage ........................................................................................ 9-7
Configuration and Application Development ............................................................................ 9-7
Known Issues ........................................................................................................................... 9-8
Troubleshooting ....................................................................................................................... 9-9
vi SB1 Programmer’s Guide

ABOUT THIS GUIDE

Introduction

This guide provides information developing applications for use on the SB1.
NOTE Screens and windows pictured in this guide are samples and may differ from actual screens.

Documentation Set

The documentation set for the SB1 is divided into guides that provide information for specific user needs.
SB1 Regulatory Guide - provides all regulatory and safety information.
SB1 User Guide - describes how to use the SB1.
SB1 Integrator Guide - describes how to set up the SB1 and accessories.
SB1 Programmers Guide - describes how to develop applications for the SB1.

Chapter Descriptions

Topics covered in this guide are as follows:
Chapter 1, Introduction - provides an introduction to the Programmers Guide.
Chapter 2, Application Integration - Lists the steps required for integrating and installing applications on th e
SB1.
Chapter 3, Application Shared Library - describes the modules of the Application Shared Library.
Chapter 4, Configuration - Lists the options available in the SB1 configuration file.
Chapter 5, Localization - describes localization support for the SB1.
Chapter 6, Additional Notes - provides additional recommendations and best practices for using the SB1.
xxxvi SB1 Programmer’s Guide
Chapter 7, App Development and Deployment Guidelines - provides guidelines for application
development and deployment.
Chapter 8, Using Fonts on the SB1 - provides information for using fonts.
Chapter 9, Running off-line Web Applications - describes how to run application off-line.

Notational Conventions

The following conventions are used in this document:
The term “SB1” refers to the Zebra SB1 smart badge.
Italics are used to highlight the following:
Chapters and sections in this and related documents
Folder names
Bold text is used to highlight the following:
Key names on a keypad
Button names on a screen.
Dialog box, window and screen names
Drop-down list and list box names
Check box and radio button names
Icons on a screen.
Courier Bold text is used to highlight filenames.
Bold Italic text is used to highlight MSP package names.
Bullets (•) indicate:
Action items
Lists of alternatives
Lists of required steps that are not nece ssarily sequential.
Sequential lists (e.g., those that describe step-by-s te p pr oc ed ur e s) ap pe a r as nu m be re d lists.

Related Documents and Software

The following items provide more information about the SB1.
SB1 Regulatory Guide, p/n 72-162415-xx
SB1 User Guide, p/n 72E-164711-xx
SB1 Integrator Guide, p/n 72E-164712-xx
Administrating MSP 4.0, p/n 72E-128775-04
Understanding Mobility Services Platform 4.0, p/n 72E-128712-05
Mobility Services Platform 4.0 Software Installation Guide, p/n 72E-100159-13
Mobility Services Release Notes, p/n 72E-100160-17
Using Mobility Services Platform 4.0, p/n 72E-128802-05
About This Guide xxxvii
For the latest version of this guide and all guides, go to: http://www.zebra.com/support
xxxviii SB1 Programmer’s Guide

CHAPTER 1 INTRODUCTION

This guide provides the starting point for developing applications for the SB1 Shell environment. It provides basic information about the system environment, what types of applications can run in this env iro nm e nt , system libraries and how to access device capabilities.
The SB1 Shell is a multi-instance, multi-tasking application which enables RhoElements “hybrid” (HTML/JavaScript) applications to run concurrently, interact with each other and share device and system resources. The Shell runs within RhoElements and uses the Webkit engine. This means that most rules and specific attributes that can be found in Webkit are available in the SB1 Shell.

SB1 System Applications/Shell UI Services

These applications are:
Home - the starting point of the SB1 Shell and gives access to all its functions and applications.
AppLauncher - responsible for listing and managing client applications. Also includes a Task Manager
enabling users to observe running apps as well as quitting them.
Settings - provides UI for managing device capabilities and SB1 Shell settings. Settings is split into
different sections.
• Main settings - Provides basic UI for observing battery and wireless status as well as volume and beeper control.
• More settings - Provides control points for PTT Express, Screen calibration, Beeper settings and Advanced Settings. This menu item can be protected by PIN.
• Advanced settings - Provides control points for Device Manager Settings, RD Client, Wireless and Date and time settings, Software Version etc., This menu item can be protected by PIN code.
Lock - Lock screen is a web page which will be displayed when user configurable inactivity time reached.
This lock screen can be configurable in config.js or and API can be used to set custom lock screen.
1 - 2 SB1 Programmer’s Guide
Figure 1-1
Figure 1-2
Lock Screen
Badge - Badge screen is a web page which displays when user device moved to upside down and configurable delay time reached. This badge screen can be configurable in config.js or and API can be used to set cuctom badge screen.
Badge Screen
Notifications - gives access to the notificat ion s re ce iv ed fro m th e different server applications, from other devices and the system itself.
Profile - provides the user a way to customize their SB1 by setting their name and title as well as signing out or switching device.
Introduction 1 - 3
Settings PageApp Launcher
Profile PageHome page with Wireless
and PTT Shortcuts
Home Page
Badge ScreenLock ScreenNotification List
Figure 1-3

Namespaces

This section provides information on the JavaScript objects namespaces, e.g. each layer in the Structure section is encapsulated by a JavaScript object (namespace):
All of the modules described are provided with their namespaces.
System Applications
Application Shared Library - asl Shell UI Services - sui Shell System Library - sys
1 - 4 SB1 Programmer’s Guide
Figure 1-4
Structure Diagram

SB1 Client Applications

The SB1 Shell is designed to run custom built web based client applications. They are required to meet the following technical specifications:
Backend
Web applications can implement some specific logic based on the workflow required. The implementation can be made in various technologies and programming languages (C#.NET, RoR, PHP, etc.). The SB1 Shell does not interact with the application backend. A pplica tio ns wr it te n in an y clien t- s e rver en vir on m en t ha s to be hosted on a server and need to be accessible through a network. The SB1 Shell should be configured to know the address of an application provided as an application URL. SB1 Shell then will create an application icon and will allow application to be started and running into their own application pool implemented as an iframe.
Frontend
The SB1 Shell runs in in RhoElements web browser that has support for HTML 5. SB1 Shell applications are HTML page that can be implemented using HTML5, CSS3 and Javascript. This allows application designers to take advantage of the latest improvements as markup elements, web databases, browser local and session storages and browser caches.
CSS
The SB1 Shell supports the CSS 3 official specification with webkit extensions.
JavaScript
The SB1 Shell supports the JavaScript ECMAScript 3 with some extensions from ECMAScript 5. Refer to RhoElements documentation for more information.

Quick Start Guide

Once device open from package box users need to place the device on cra dle to reboot the device an d charge. After charging the device, now device is ready to configure.

Develop First SB1 Application

Develop any thin client web application and deploy on any remote server or develop any HTML 5 based app and deploy on device.
Introduction 1 - 5
<!DOCTYPE html> <html>
<head>
<title> This is hello SB1 sample </title>
<!- Add asl.js reference in all web pages -->
<script type="text/javascript" src="http://127.0.0.1:83/Application/www/sapp/src/asl.js"></script>
<!- Use asl APIs to set the page title and back arrow, options --> <script type="text/javascript">
asl.title('Hello SB1 Demo'); asl.back(function (t) { asl.exit(); }, 'http://127.0.0.1:83/imagepath/ic_x.png');
asl.options([ {
title: 'About', callback: function() {alert('This is a sample app to demonstrate Hello SB1
Sample');} }, {
title: 'Quit',
callback: quit }
]); function quit() { confirm('Are you sure you want to quit the current application?',
function(confirmation) {
if(confirmation) {
asl.exit(); }
})
};
</script>
</head>
<body> <!- Construct business page here --> Hello SB1. </body>
</html>
1 - 6 SB1 Programmer’s Guide

Add Hello SB1 App in apps.json

Copy the config folder from SB1 Toolkit and add the Hello SB1 app in apps.json.
{ "name": "hello", "url": "http://127.0.0.1:83/UserDrive/apps/hello/hello.html" }

Deploy the Hello Application

Manual Deployment

1. Connect the SB1 to a host computer using a USB cable. In a file explorer application, the Logs folder and
Fusion data folder display as shown.
Figure 1-5
2. Copy the apps folder and the config folder from host computer to the UserDrive folder on the SB1.
Logs and Fusion Folders
Introduction 1 - 7
Host Computer Host SB1
3. Reboot the SB1.
4. Go to Applauncher and find the Hello application .
Figure 1-6
5. Select the Hello application.
Figure 1-7
Applauncher
Hello SB1 Application

Deployment using RDT Solo for Many Devices

If customers deploy their web applications on any remote server, the proper app URL to be configured in apps.json.
You can use the Zebra RDT Solo application to upgrade to latest OS, WLAN Profile and application configurations.
1 - 8 SB1 Programmer’s Guide
View the videos on using RDT Solo to deploy applications:
Using RDT to stage the SB1 on a WLAN network
How to Perform an OS Update on the SB1 Device using RDT

CHAPTER 2 APPLICATION INTEGRATION

Each client application that meets the technical specifications can be integrated and installed on the SB1. In order to create SB1 Shell applications developers should follow specific requirements that are listed below:
create HTML5 compliant web application
integrate SB1 Shell shared library
This document doesn't aim providing help or res ourc es on cre at ing HTM L 5 com p lian t applications.

Integration with SB1 Shell

System Integration

NOTE If the client application page is to be served from a remote location, it must refer to a copy of the asl.js
library from the same location. This is due to Web Security Standards which will not allow a remote page to load JavaScript from a local address.
Every HTML page within an SB1 application must include a special library called asl.js. This library provides the following services in the SB1 multi-instance environment:
application services
notification services
keyboard services
shared UI services
resource services
messaging services
authentication services
window services.
The following code shows an example of how to include asl.js within an HTML page:
2 - 2 SB1 Programmer’s Guide
<head>
... <script type="text/javascript"
src="http://127.0.0.1:83/Application/www/sapp/src/asl.js"></script>
... </head> <body>
...
NOTE The asl.js file must be the first JavaScript file included in the client application document. asl is always
the first library that access the document model and document events. This is required because the application system library needs to setup a connection with the SB1 Shell to initialize the device profile.
Client application logic implementation should never override the asl namespace. Application developers should never use statements in JavaScript that override the application shared library object - asl.
It is recommended that asl.js is linked to the local SB1 web server on http://127.0.0.1:83/Application/www/sapp/src/asl.js. This will preve nt applications from dealing with asl library versions and they will be always using the latest asl file for the current Shell instance.

Visual Integration

The SB1 Shell includes a style sheet file that overrides the default styling of the web document. It is recommended that client applications running on the SB1 use these styles in order to achieve consistent application look and user experience. The style sheet can be included in HTML documents by adding the link tag that is shown in the following example:
<head>
<script type="text/javascript"
src="http://127.0.0.1:83/Application/www/sapp/src/asl.js"></script>
<link rel="stylesheet" type=”text/css” href="path/asl.css"></link>
… </head> <body>
...

Installation

Once an application is prepared to communicate with the SB1 Shell by linking asl.js, it has to be installedon the SB1 instance that will be running it. This can be done by adding the application in the SB1 SHell installation file apps.json. Depending on the configuration scheme, this file can be found on different locations.
SB1 Shell default configuration file is located on the following location:/Application/www/config/config.js Third party application providers can override the default con fig uration file by uploading their custom configurations on /UserDrive/config/config.js. This file is called user configuration file for SB1.
Application Integration 2 - 3
One of the settings that user configuration file contains is called config.app s.src which holds the addr ess to the application list that will be installed.
In general, the SB1 has two primary configuration files:
config.js
apps.json

config.js File

The config.js file, in the config folder, is the general configuration file for SB1. One of the values it contains is called config.apps.src which holds the address to the application list that will be installed. By default, the value is:
config.apps.src = ‘‘/UserDrive/config/apps.json;
NOTE The apps.jason file can be located at a remote location. For example:
config.apps.src = ‘http://www.example.com/config/apps.json;
Once a remote location is set for this file, the system downloads it to a device location, configured in
config.apps and then fetches the listed applications from this file.
See Chapter 4, Configuration for more information.
NOTE The apps.json file can be made variable based on the logged-in user. If Single Sign-On authentication
is configured, the authentication server can send a different system loads the user applications once the user logs in successfully. See Authentication Services on
page 3-27 for more information.
apps.json file depending on the user. The

apps.json File

The apps.json file, in the config folder, contains the list of the applications that are installed once the SB1 Shell is configured. It is formatted in JSON, a JavaScript native format. To add an application to this list, create a list element and insert it before or after any other list el ement in the file is manual. Take caution in editing. Be sure to include the proper synt ax (i.e., qu otes, commas and slashes). Modifications to the
apps.json file will not take effect unless the SB1 is rebooted.
Example
},
{
"name": "App X", "url": "http://www.example.com/index.html",
"icon": "http://www.example.com/assets/icon.png" }, {
apps.json file. Editing of the apps.json
where:
2 - 4 SB1 Programmer’s Guide
name = name of the application. This pa rameter is mandatory and must be unique for an apps.json file, otherwise the application will not be recognized by the system.
url = address where the application can be found. This parameter is mandatory.
icon = a path to the icon to be shown in the Applications application on the SB1. This parameter should be an absolute path. For example: http://example.com/images/icon.png. Relative paths will not work: /images/icon.png.
Applications need a permission to overwrite custom badge. canOverwriteBadge = true can be configured to overwrite badge.
Table 2-1
S NO Configuration Description
1{
Sample app configuration with necessary permissions.
name: "MWM", Name of the app url: "http:// <SERVER IP >/MWM/TSD", application URL. The application URL may be
either local or remote depends on application deployment.
icon:"http://127.0.0.1:83/UserDrive/mwm/Taskworker_ SB1.png",
canOverwriteBadge: true, Permission for a app to overwrite default
canClearNotifications : true, Permission for a app to clear notifications canOverwriteProfile : true, Permission for a app to set the profile.
canAddApplications : true, Permission for a app to add dynamically
Icon to be displayed on app launcher
Badge. Applications can set custom badge using asl.badge()
Depends on user locale shell will be reloaded in case of localization.
another app
disableKeyboard : true Enable/Disable a SIP keyboard for the app.
Apps can use their own keyboard.
isProcessApp: false, Permission for a process app. Process app
will not be displayed in applauncher. Add true for process app and add false for all normal
apps. canCloseApp: true, Permission for app to close. canCloseApplications: true Permission for a app to close another App }
Once configured, the application is accessible from the SB1 Application screen.
Application Integration 2 - 5
Figure 2-1
Applications Screen
NOTE The position of the application icon in the Applications screen depends on the position of the
configuration element in the
apps.json file.
Remote apps.json file
The apps.json file can be placed on a remote location and SB1 Shell can be instructed to load the remote apps.json file by default. This configuration brings a specific behavior on device reboot. Once the device reboots and SB1 Shell starts, The Shell will try to find the remote apps.json file, to download it and load the application configuration. In some occasions after reboot the wireless connection is not availabl e at the time of Shell resource loading e.g. downloading the apps.json file. If the shell detects that the wireless is not active and file is not downloadable, it will wait until the signal NPAPI object returns a successful status for the wireless connection and then it will reinstantiate the procedure of downloading and installing applications. A side effect of this scenario is that users may see the Application Launcher empty until a valid wireless signal is available and the apps.json file is downloaded.
Starting Applications
When users starts an application, the SB1 Shell will create an application pool (iframe) and will start loading the application home page. During page loading, the SB1 Shell will display an hourglass icon to indicate SB1 that there is an ongoing process. The SB1 Shell loading cycle includes the following steps:
assign an application pool (iframe) for the started application
set the application home page as source of the iframe
show hourglass to indicate users that application is loading
start a timeout function that waits for the application load and handshake process
assign an onload event of the application iframe
once the onload event of the application iframe occurs, Shell st arts a handshake process which includes sending system information to the application via HTML 5 postMessage
SB1 Shell waits for a response from the application and if it receives it, it will automatically destroy the timeout and send back to the application an asl onloaded event
If the SB1 Shell does not receive the iframe onload event or a handshake confirmation from the application, in a configured interval of time it will prompt the user with a notification that informs them that the current application is busy or not loaded from the server.
2 - 6 SB1 Programmer’s Guide
Figure 2-2
Figure 2-3
SB1 Shell Notification - Wait or Quit Application Due to Slow Loading
SB1 Shell Notification - Reload or Quit Application Due to Slow Loading
Figure 2-4
The Shell tries to reload the last requested page automatically once th e network is restored. Once the ne twork is connected, the device IP address will display at the bottom of the no network image.
Not Connected to Network
NOTE Application handshake process is handled by the asl library. If this library is not included or not accessible
in the application iframe, applications will not be able to work in the Shell environment and users might consistently get the Wait/Quit notification.

Developer Content

All developer content can only be placed in the \UserDrive folder of the SB1. Basic configuration of an SB1 should have a folder structure similar to:
Loading...
+ 92 hidden pages