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.
The Datalogic Xamarin 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, Xamarin broadcasts the IntentActionBatteryChanged 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 SendStickyBroadcast .
The standard Android SDK doesn't allow turning 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 by providing the class LocationManager . Here's 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.