Skip to main content

SDK Integration

Overview

This section outlines the capabilities of our SDK, which facilitates seamless integration with the Android Aladdin application. The SDK provides a sophisticated subscription model, enabling developers to efficiently receive and manage scanned data. With built-in functionalities for both subscribe and unsubscribe operations, developers gain a professional and adaptable solution for incorporating scanned data into their applications.

AlManager

Class AlManager

Functions

NameSummary
ensureConnectionToService (context: Context): BooleanConnect to the Aladdin App, if not connected already. Triggers a Service Binding via (AIDL) IPC to the Aladdin App. Will automatically re-establish the connection if necessary.
isConnectedToScanner: BooleanInformation, if this HHS is currently connected to the Aladdin App or not.
isConnectedToService: BooleanInformation, if this Service is currently connected to the Aladdin App or not.
subscribeToScans (callback: IScannerOutput)Subscribe to HHS Connection Information and Scanned Barcodes.
subscribeToServiceEvents (callback: IServiceOutput)Subscribe to Connection Information of the sdk-service.
unsubscribeFromScans (callback: IScannerOutput)Unsubscribe from HHS Connection Information and Scanned Barcodes.
unsubscribeFromServiceEvents (callback: IServiceOutput)Unsubscribe Connection Information of the sdk-service.

IScannerOutput

interface IScannerOutput

NameSummary
onBarcodeScanned (barcode: String)Callback Method that is called for each scanned barcode. It will only be called once per Barcode.
onScannerConnectedNotifier function that is called once an HHS is connected to Aladdin App.
onScannerDisconnectedNotifier function that is called once an HHS Scanner is disconnected from Aladdin App.

IServiceOutput

interface IServiceOutput

NameSummary
onServiceConnectedCallback for the successful ServiceConnection.
onServiceDisconnectedCallback for a disconnection from the service.

Aladdin Client

"Aladdin Client" is a purposefully crafted sample application designed to showcase the dynamic capabilities of our SDK. This app stands as a practical illustration of how seamlessly our SDK integrates into Android environments. With an array of buttons representing distinct features, developers can interactively explore and understand the SDK's functionalities.

Aladdin_Client

Exploring Button Capabilities

Subscribe To Service Events:

Subscribe to Connection Information of the sdk-service. You will get notified when you are connected or disconnected from Aladdin application.

Subscribe_to_Service

Connect To Service:

Connect to the Aladdin application. Triggers a Service Binding via (AIDL) IPC to the Aladdin application.

Connect_to_Service

Subscribe To Scans:

Subscribe to Connection Information and Scanned Barcodes. You will get notified when you are connected or disconnected from HHS Scanner and Scanned Barcodes data.

Subscribe_to_Scans

Is Connected To Scanner:

Will get information related to scanner, whether it is currently connected to the Aladdin application or not.

Is Connected To Service:

Will get information related to service (Client App), whether it is currently connected to the Aladdin application or not.

Get Latest Scan Value:

Get the last scanned value from the HHS.

Unsubscribe From Scans:

Unsubscribe from Connection Information and Scanned Barcodes. You will not get any information related to scanned barcodes and HHS connections.

Unsubscribe From Service Events:

Unsubscribe Connection Information of the sdk-service. You will not get any information related to Connection (like connected/disconnected) with Aladdin application.

Steps to Receive Bar code in Aladdin Client App

  1. Install both applications (Aladdin and Client) in the device.

  2. Connect to Hand Scanner from Aladdin application and select "Integration method" as SDK.

    Integration_Method

  3. Once the HHS is connected to the Aladdin application, select "Subscribe" to service events in client application.

  4. Tap "Connect to service" in the client application. Once connection is successful, you will get connection toast message.

  5. Tap "Subscribe to Scan" in client application.

  6. Now you can scan the barcode data from HHS device. You will get a toast message with scanned data in Client Application.

    Toast_Message