|
"SmartDevicesPlusUtil" or "WorkWithPlusNMUtils" in newer versions, is an External Object that contains methods than can be used to simplify some tasks that are necessary in most projects. This External Object is imported into the Knowledge Base when you run the "Design System Wizard" and will be available so you can easily use it:

Newer versions:
ToggleAndroidChartsScroll and ToggleAndroidUCScroll methods are deprecated.
This method lets the user take a screenshot with a specific width and height so you can customize the resolution of the image. If the width and height are left in 0, the image from the screenshot will have the resolution of the device.
If you set whether the width or the height (and leave the other value in 0) the image from the screenshot will be adjusted to keep the proper resolution.
TurnOnScreenRecording and TurnOffScreenRecording can be used to disable application screenshots.
This functionality is currently only available in Android.
To use this functionality, you must invoke these methods at the time you need:

This could be useful in screen in which you handle sensitive data.
Converts a size from dips to pixels, considering current device screen density.
Converts a size from pixel to dips, considering current device screen density.
Returns current device screen width in pixels.
Returns current device screen height in pixels.
Take the hexadecimal value, transforms it to decimal and separates it into RGB colors.
Converts a hexadecimal value to decimal.
Converts a decimal value to hexadecimal.
Deprecated: Newer versions use it from ImageManipulation: ImageToBase64.
This method let convert an image to Base64.
Deprecated: Newer versions use it from ImageManipulation: ImageFromBase64.
This method let convert Base64 string to an image.
Deprecated: As of GenXus 18 Upgrade 13 this functionality is provided natively by GeneXus
TurnOffSleepMode and TurnOnSleepMode can be used to turn on or off the phone's "sleep mode" to prevent screen blocking.
This functionality is currently only available in Android.
e.g.:

Deprecated
SetScreenBrightness and GetScreenBrightness can be used to change the phone's screen brightness.
This functionality is currently only available in Android. Requires user to manual modify the "AndroidManifest.xml" file, to add the following permission: <uses-permission android:name="android.permission.WRITE_SETTINGS" />
For example, if you want to change the screen brightness to the max value and then change it back in another moment, you only need to do the following:

Deprecated
You can use a method to detect when the user "shakes" the phone. This can be used to execute any action, for example, change current page, play a sound, delete current record, etc.
This functionality is currently only available in Android.
e.g.:
If you are working in Android and you want to use it, first you need to turn on the shake listener with the method TurnOnShake:

Then, you need to implement the code which will be executed in the event OnShake:

In this example, we are just counting how many times the user has shaked the device.
Finally, when you want to finish listening you need to use the method TurnOffShake:

Deprecated
Event that is triggered when the phone is shaken.
|