Change screen brightness

In SmartDevicesPlus 5 were added some new methods in the External Object SmartDevicesPlusUtil. These functionalities are currently only available for Android.

These new methods allow to change and obtain the screen brightness:

The GeneXus IDE Structure tab of the SmartDevicesPlusUtil external object lists its methods, including ToggleAndroidChartsScroll, TakeScreenshot, ImageToBase64, ImageFromBase64, and, highlighted in red, SetScreenBrightness(Percentage) returning Boolean and GetScreenBrightness returning Numeric(3.0).

For example, if you want to change the screen brightness to the max value, but first you need to obtain the current value so you can change it back in another moment. You only need to do the following:

GeneXus code in the Brightness panel's Events tab shows an event 'MaxBrightness' calling SmartDevicesPlusUtil.SetScreenBrightness(100), annotated "100 Percentage", and a Start event calling &initial = SmartDevicesPlusUtil.GetScreenBrightness(), annotated "Obtain the brightness".