This tutorial shows common operations done on an Android device to gather information. The sample app is divided into several Activities, one per each topic.
Datalogic SDK provides advanced information about the device in the class SYSTEM , which exposes Wi-Fi type, keyboard type and others as static members. Example usage:
To get information about the battery, Android broadcasts the IntentIntent.ACTION_BATTERY_CHANGED() which carry information in its extra properties. The intent is fired every time the status of the battery changes and once when you register a receiver, notice that this particular behavior happens because the battery intent is a STICKY one Context.sendStickyBroadcast() .
Standard Android SDK doesn't allow to turn on or off the Location providers (GPS, network, etc...) thus an application must ask to the user to manually do it. Datalogic SDK overcome this limit providing the class LocationManager , here how to use it:
Standard Android SDK doesn't allow to turn on or off the NFC adapter, thus an application must ask to the user to manually do it. Datalogic SDK overcomes this limit providing the class NfcManager , here how to use it:
Datalogic SDK allows to control LEDs on the device (*). The standard Android APIs for controlling the notification LED via the notifications system still works, though you are limited to 1 LED, while Datalogic devices may have more LEDs, moreover using Datalogic LedManager the control is easier.
*Please notice that not all LEDs on a device can be freely controlled by a user application, as some are reserved to the system.