Device

Perform various device related functionality

Reference the library

C#
using CI.WSANative.Device;

Enable the flashlight

Enables the devices rear flashlight if one exists

C#
WSANativeDevice.EnableFlashlight();

Disable the flashlight

C#
WSANativeDevice.DisableFlashlight();

Take a screenshot

Captures the contents of the screen buffer and converts it to png - you should call this after "yield return new WaitForEndOfFrame();" to ensure that rendering is completed first

C#
WSANativeDevice.CaptureScreenshot();

Take a picture with the camera

Launches the camera capture UI allowing the user to take a picture

C#
WSANativeDevice.CapturePicture(0, 0, response => { });

Vibrate

Vibrates the device for the specified number of seconds - seconds can be in the range 0 to 5

C#
WSANativeDevice.Vibrate(2);

Create a progress bar

Creates an indeterminate progress bar - setting this height has no affect

C#
WSANativeDevice.CreateProgressBar(new WSAProgressControlSettings() { HorizontalPlacement = WSAHorizontalPlacement.Centre, VerticalPlacement = WSAVerticalPlacement.Centre, Width = 45, Colour = new Color32(255, 20, 147, 255) });

Destroy a progress bar

C#
WSANativeDevice.DestroyProgressBar();

Create a progress ring

Creates an indeterminate progress ring

C#
WSANativeDevice.CreateProgressRing(new WSAProgressControlSettings() { HorizontalPlacement = WSAHorizontalPlacement.Centre, VerticalPlacement = WSAVerticalPlacement.Centre, Height = 45, Width = 45, Colour = new Color32(255, 20, 147, 255) });

Destroy a progress ring

C#
WSANativeDevice.DestroyProgressRing();