public class DatalogicCoreSDK
extends java.lang.Object
The main SDK object, used to search Datalogic Bluetooth devices and to obtain DatalogicDevice instances. "android.permission.ACCESS_COARSE_LOCATION" permission is needed by DatalogicSDK to allow binding and connection directly inside the application, without going on "Settings" panel. This could led, in some case, to give a false positive from some antivirus that signals the application like a threat.
Modifier and Type | Class and Description |
---|---|
static interface |
DatalogicCoreSDK.Callback
Management of DatalogicCoreSDK's events
|
Modifier and Type | Method and Description |
---|---|
protected void |
disconnect() |
void |
enableBluetooth()
Enable Bluetooth services on Android device
|
static DatalogicCoreSDK |
get(android.content.Context context,
DatalogicCoreSDK.Callback datalogicCallback)
Method to obtain a DatalogicCoreSDK object
|
android.bluetooth.BluetoothAdapter |
getBluetoothAdapter()
Used to retrieve the Android BluetoothAdapter
|
java.util.List<DatalogicDevice> |
getBondedDevices()
Return the set of
DatalogicDevice objects that are bonded (paired) to the local adapter. |
DatalogicDevice |
getDeviceByAddress(java.lang.String mac)
Returns a DatalogicDevice object that let you connect to a Datalogic Device
|
java.lang.String |
getMacAddress()
Obtain the device MAC address
|
protected java.lang.String |
getNameByMac(java.lang.String mac) |
static java.lang.String |
getRelease()
Returns the string containing SDK's release version
|
boolean |
isBluetoothAvailable()
Returns true if Android device supports bluetooth, false otherwise
|
boolean |
isBluetoothEnabled()
Tests if Android's Bluetooth services are enabled
|
protected boolean |
isConnected() |
protected void |
send(byte[] data) |
protected void |
send(java.lang.String data) |
void |
stop()
Stops the SDK
|
protected void |
tryConnection(DatalogicDevice datalogicDevice)
Try the connection
|
public static DatalogicCoreSDK get(android.content.Context context, DatalogicCoreSDK.Callback datalogicCallback)
context
- Android ContextdatalogicCallback
- callback to manage DatalogicCoreSDK's eventpublic static java.lang.String getRelease()
public java.lang.String getMacAddress()
public boolean isBluetoothAvailable()
public void enableBluetooth()
protected void tryConnection(DatalogicDevice datalogicDevice)
datalogicDevice
- Datalogic device objectprotected void disconnect()
public android.bluetooth.BluetoothAdapter getBluetoothAdapter()
protected java.lang.String getNameByMac(java.lang.String mac)
protected boolean isConnected()
public void stop()
public boolean isBluetoothEnabled()
protected void send(java.lang.String data)
protected void send(byte[] data)
public DatalogicDevice getDeviceByAddress(java.lang.String mac)
mac
- Datalogic device's MAC addresspublic java.util.List<DatalogicDevice> getBondedDevices()
DatalogicDevice
objects that are bonded (paired) to the local adapter.DatalogicDevice
objects that are bonded (paired) to the local adapter.