To control the scanner, the scanner must be in Bluetooth SPP mode (Serial Port Profile).


Tools and environment

  • Android Studio 3.5.2++
  • Android SDK29+


Implementation


  1. Import the bIM_SDK.aar library into the libs directory of your project for normal transmission in Bluetooth SPP mode.
    Import the blelibrary.aar library into the libs directory of your project if you want the scanner to work in BLE mode.
  2. Add the aar package to build.gradle under app as a dependency

    dependencies {
    .....
    implementation(name: 'bIM_SDK', ext: 'aar')
    ....
    }
  3. Add the following code to android {} 

    repositories {
        flatDir {
            dirs 'libs'
        }
    }
     
  4. Register the relevant permissions and services via the AndroidManifest.xml:

    <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.SYSTEM_ALERT_WINDOW"/>
        <application>
            <service android:name="com.bim.bluetooth.BluetoothService" android:enabled="true" >
            </service>
        </application>