The DataSampler module samples detailed device data and reports it back to the AirWatch Console. Device details such as analytics, call logs, GPS location, and network adapters are all sampled with the DataSampler.

The DataSampler samples and transmits on two different time intervals. Device samples remain on to the disk and the system removes them after transmitted. This process allows the developer to sample statistics multiple times before sending them to AirWatch. Samples stored on the disk are useful when a device does not have network connectivity.

AWDataSampler is a singleton object. There can only be one DataSampler for each process.


These parameters are required to set up a DataSampler.

  • sampleModules – Names the bitmask whose flags specify which modules to use.
  • defaultSampleInterval – Specifies the time in seconds between DataSampler samples for all modules by default.
  • defaultTransmitInterval – Specifies the time in seconds between DataSampler transmissions for all modules by default.
  • traceLevel – Determines the error and information logging level of the DataSampler module when it is running.

Modules Available for Sampling

These modules are available for sampling in the DataSampler.

  • AWDataSamplerModuleSystem
  • AWDataSamplerModuleAnalytics
  • AWDataSamplerModuleGPS
  • AWDataSamplerModuleNetworkData
  • AWDataSamplerModuleNetworkAdapter
  • AWDataSamplerModuleWLAN2Sample

Gather Telecom Data

Disable the AWDataSamplerModuleNetworkData mask if you gather telecom data using the AirWatch Agent. If you enable this mask for the SDK, then you receive duplicate data from the Agent and from the SDK.

Set Do Not Disturb

You can use the SDK to set the do-not-disturb (DND) status on the AirWatch server. You must enable the DND policy in the AirWatch Console. You can find the policy at Groups & Settings > All Settings > Devices & Users > General > Privacy > DO NOT DISTURB section .

The two relevant methods are fetchDeviceDNDStatus and setDeviceDNDStatus found in the AWDeviceDNDStatus object.


The AnalyticsHelper is a singleton with a property and a function. Program the singleton or enable it in the console.

To program it, set the enable property to true after controllerDidFinishInitialCheck. To record an event call the recordEvent method with specified parameters using the singleton object.