Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Introduction

This document provides support and recommendations on how to integrate the Tire Size scanner into web pages or web applications to achieve the best possible usability and user experience.

...

Extract the Parameters (Width, Ratio …) of the Tire Size

Beside the scanned result string, the SDK also returns the different parameters of the Tire Size string (width, ratio, diameter, load index, speed rating …). A detailed overview of all fields can be found here.

How to access the different fields is described here in the documentation - there you can also find an update guide, if you used the Tire Size scanner already before SDK version 42 and want to use this feature.

...

Best Practices for User Guidance

Provide a possibility to replace the manual input by scanning (call to action)

In the workflow where the user is supposed to enter the tire size, ideally a button should be placed to allow the user to use the scanner instead. The button should clearly communicate to the user what to expect.

Provide information about how the scanner works and what the user has to do

...

For  an end-user / self-service application, it is important to provide guidance to the user before the user uses  the scanner. For this purpose, a tutorial video, a tutorial animation, a tutorial graphic or a short written tutorial is suitable.

...

While the user is looking at the instructions, the scanner can already be loaded and initialized in the background (does not work with a redirect in between). For example, the instructions can be displayed one visible layer above the scanner.

...

Reduce the Initialisation Time of the Scanner

The Anyline JavaScript SDK has a pre-loading functionality, more details about this can be found in the documentation. It is even better if the scanner is already initialized (hidden) "under" an instruction overlay to keep the effective waiting time for the user as short as possible.

...

User Guidance & Elements in the ScanView

ScanView Setup

Expand
titleClick to expand
  • The user should be able to cancel the scanning process at any time in order to make the entry manually instead. In the end, there is always a possibility that the user just does
    not like the scanning process and prefers to enter the data manually, especially if they are a domain expert.

  • Although the scanning process is very simple, some users may certainly feel overwhelmed with the functionality. We recommend therefore that after about 10-15 seconds a message is displayed asking if the user wants to return to manual input, in case the device is too slow or the user is
    not able to perform the scan successfully.

Providing a Textual Tire Size Example

Expand
titleClick to expand
  • In order to provide the best usability for every user, even if they have absolutely no affinity for tires, we recommend providing guidance in the ScanView. That is, to communicate during the scan process what the user should look for.

  • We recommend showing a picture of a tire size or to give a textual example of a Tire Size.

Example:

Cancel Option

Expand
titleClick to expand
  • The user should be able to cancel the scanning process at any time in order to make the entry manually instead. In the end, there is always a possibility that the user just does
    not like the scanning process and prefers to enter the data manually, especially if they are a domain expert.

  • Although the scanning process is very simple, some users may certainly feel overwhelmed with the functionality. We recommend therefore that after about 10-15 seconds a message is displayed asking if the user wants to return to manual input, in case the device is too slow or the user is
    not able to perform the scan successfully.

Flash/Torchlight Usage

Expand
titleClick to expand
  • Since tires often have to be scanned in low light conditions, the user should have the possibility to use the Flashlight. Unfortunately, iPhones block access to the Flashlight API of the browser, so the use of the flash is only possible on Android phones, which is a technical limitation that has nothing to do with Anyline.

  • However, since iPhones are equipped with a very good camera anyway, which also works well in low-light conditions, this is not a strong limitation. Therefore, we  recommend that the option to turn on the flash is only visible on Android. Example code for flashlight usage can be found in the SDK example code.

Lock Screen Orientation & Full Screen Mode

Expand
titleClick to expand
  • We generally recommend activating the "Full Screen Mode" in the browser and fixing the screen orientation when scanning. This way, the user has the full screen available for scanning and the screen cannot rotate during scanning. This is very easy to implement using JavaScript, you can find information about the browser API herecan find information about the browser API here.

  • For locking the screen orientation in the web browser activating the "Full Screen Mode" before is mandatory.

  • You can also use this SDK feature (code belowExample 2) to lock the screen orientation. If you want to be in full control and don’t want to use the SDK API, you can also find an example implementation at the end of the document(Example 2).

Example 1:

Code Block
languagejs
// import the Web SDK
const { init, errorCodes } = window.anylinejs;

// if copied into node_modules
// import { init, errorCodes } from 'anyline-js';


// create a view configuration
const viewConfig = {
    ...
};

const anylicense = 'xxxxxxx-your-license-xxxxxxx';

// access the container you want to mount the Web SDK into
const root = document.getElementById('root');

// initialize the Web SDK with optional presets
// presets will override some dimension configuration of your viewConfig and modules in the Web SDK config
const Anyline = init({
    lockPortraitOrientation: {
        // set the element which will be used for fullscreen mode.
        element: root,
        // enable lock screen orientation
        lock: true,
    },
    preset: 'germanid',
    viewConfig,
    license: anylicense,
    element: root,
});

Anyline.startScanning();

Anyline.onResult = function(result) {
    console.log('Anyline has result: ', result);
};

Example 2:

Code Block
languagejs
// (A) LOCK SCREEN ORIENTATION
function lock (orientation) {  // 'portrait' or 'landscape'
  // (A1) GO INTO FULL SCREEN FIRST
  try {
    let de = document.documentElement;
    if (de.requestFullscreen) { de.requestFullscreen(); }
    else if (de.mozRequestFullScreen) { de.mozRequestFullScreen(); }
    else if (de.webkitRequestFullscreen) { de.webkitRequestFullscreen(); }
    else if (de.msRequestFullscreen) { de.msRequestFullscreen(); }

    // (A2) THEN LOCK ORIENTATION
    screen.orientation.lock(orientation);
  } catch (e) {
    // not supported in the browser
  }
}

// (B) UNLOCK SCREEN ORIENTATION
function unlock () {
  // (B1) UNLOCK FIRST
  try {
    screen.orientation.unlock();

    // (B2) THEN EXIT FULL SCREEN
    if (document.exitFullscreen) { document.exitFullscreen(); }
    else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); }
    else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); }
    else if (document.msExitFullscreen) { document.msExitFullscreen(); }
  } catch (e) {
    // not supported in the browser
  }
}

Infonote

Unfortunately, Apple/iPhones (iOS) only offer this API starting with iOS 16.4 (in Safari only) that means locking the screen orientation on iOS is in some cases not possible. On Android this API is fully supported.

Info

In this manner, the screen orientation could theoretically also be set forced to "landscape mode", if desired.

Position and Size of the Cutout 

Expand
titleClick to expand
  • Even though the Anyline SDK allows you to freely change the position of the cutout, we recommend placing the cutout in the centre. Depending on the device, the camera usually focuses primarily on the centre of the image by default. Especially for an end-user application that is supposed to work on a large number of devices, we therefore recommend placing the cutout in the centre.

Info

The size of the cutout can also be adjusted, but we strongly recommend leaving the default value (this is the default value for a reason). Our default value is the result of numerous tests and customer feedback, if you have any feedback regarding this, please let us know.

...

Result Object of the SDK

The JavaScript SDK returns the result as a string as well as the full-frame image of the scan, but also the image of the cut-out tire size. You can use these images if you want to.

Example

...

...

Updating to the Newest Version

Updating to the latest version is very easy and does not take much time. Provided you integrate the Anyline JavaScript SDK with NPM (Node Package Manager), you need to update as usual (like any other dependency). If you manage your dependency manually, you must replace all the JavaScript files with the latest ones. The latest version can always be found in the Anyline GitHub repository. If the JavaScript SDK is obtained via CDN, only the version number in the links must be adjusted.

...

Links to Documentation

Panel
panelIconIdf7525ff5-c295-42aa-8555-afffee4f496a
panelIcon:JS:
panelIconText:JS:
bgColor#FFFAE6

How to Integrate the Anyline JavaScript SDK

You can find detailed instructions for integrating the Anyline JavaScript SDK in the official Anyline Developer documentation. You can find sample implementations in the GitHub repository. The most current API documentation is linked in the GitHub repository. The source files can either be self-hosted or retrieved via CDN.

Panel
panelIconId803ee26c-b61d-4bd6-89ca-ecfd9325facf
panelIcon:anyline:
panelIconText:anyline:
bgColor#E6FCFF

How to use the Tire Size scanner on JavaScript

Here in the Anyline documentation information about the Tire Size scanner in general can be found (e.g. supported formats and scanning advice). A code example how to configure the JavaScript SDK to scan the Tire Size can be found here and here in the documentation.

...