Software Development Kits


Software Development Kits

The Generalscan SDK Development Kit is a SDK software package developed by Generalscan for third-party software developers using the Generalscan full range of Bluetooth scanners on Android smartphone platforms. This software package provides a variety of low-level functions, so that users do not need to understand complex Bluetooth protocols and communication mechanisms of various USB devices, so that the Generalscan Bluetooth scanner can be easily and directly embedded into your application.

The Generalscan SDK development kit provides a variety of software functions, including Bluetooth SPP communication, pairing, data transmission, Bluetooth device name modification, barcode function setting, hardware ID reading, DES encryption algorithm and decryption algorithm, standby sleep time setting. 
The source code of Generalscan SDK is maintained on GitHub, users can download it by themselves.

Import SDK to Android Studio project

1. Copy the SDK aar file to app/libs

2. Add the flatDir setting Gradle configuration to your Android project. In your root build.gradle file:

allprojects { 




flatDir { dirs 'libs' }  // add flatDir setting }


3. Open app level build.grdle file and add .aar file and kotlin runtime



implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.3.10'

implementation(name:'generalscan-sdk-1.0', ext:'aar')


4. Add the follow permissions into manifest.xml

<!-- Permission For Bluetooth -->

<uses-permission android:name="android.permission.BLUETOOTH" /> 

<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> 

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 

<uses-permission android:name="android.permission.VIBRATE" /> <!-- Permissions for USB Host (Scan Buddy) -->

<uses-feature android:name="" android:required="true" />

<!-- Show Alert Dialog in Service -->

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

5. Add the follow service declarations into manifest.xml

<service android:name="com.generalscan.scannersdk.core.session.bluetooth.



android:exported="true" />

<service android:name="com.generalscan.scannersdk.core.session.usbhost.



android:exported="true" />

<service android:name="com.generalscan.scannersdk.core.session.usbhost.



android:exported="true" />

Interacting with a Bluetooth scanner

  1. Turn on Bluetooth

  2. Start Bluetooth session after activity created

BluetoothConnectSession mBluetoothConnectSession = new BluetoothConnectSession(this);

//Setup session listener


new SessionListener()


//When session is ready


public void onSessionReady(IConnectSession iConnectSession) {

//TODO:to connect the device here or later }

//When session service initialization timeout


public void onSessionStartTimeOut(IConnectSession iConnectSession) {

//TODO:show error message }




Set the receiver to read the barcode

Setup listenter to ceceieve data


new CommunicateListener()


//Bluetooth device disconnected


public void onDisconnected()

{ showMessage("Device has been disconnected");


//Bluetooth device connect failed


public void onConnectFailure(String errorMessage) {  



//Bluetooth device connect success


public void onConnected() {    



//Scanner data received


public void onDataReceived(String data) {

mTxtReceiveData.append(data); }  

//Bluetooth command callback


public void onCommandCallback(String name, String data) {



//Battery data receive


public void onBatteryDataReceived(String voltage, String percentage) { mTxtReceiveData.append(voltage + ":" + percentage); }  

//Scanner command timeout


public void onCommandNoResponse(String errorMessage) { }  

//Data receive error


public void onRawDataReceiveError(String errorMessage, String source) { }  

//Raw data receive


public void onRawDataReceived(byte data) {




Bluetooth pairing, connection, stop session

Pair Bluetooth device

Connect Bluetooth device

BluetoothAdapter mBluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter()

BluetoothDevice device = BluetoothAdapter.getRemoteDevice(mSelectedDeviceAddress); mBluetoothConnectSession.setBluetoothDeviceToConnect(device); mBluetoothConnectSession.connect();

Stop Bluetooth session after activity is destroy

//Send current bluetooth session



Download from Google Play

Generalscan Inc.

200 Buckelew Ave, Jamesburg,  NJ, 08831, USA

+1 1469583-7367

Generalscan Electronics GmbH

Heinrich-Koulen-Weg 3,52525 Heinsberg Germany

+49 15167161256 +49 24529892299

Generalscan Electronics Limited

Room A608,6 Floor, Building 3, Ya Di Science Park, He Tai Road , BaiYun District , Guangzhou , China.

+86 022 58171186 

  • LinkedIn - Beyaz Çember
  • Heyecan - Beyaz Çember
  • Facebook - Beyaz Çember
  • YouTube - Beyaz Çember

Copyright ©2020 All rights reserved