In Genexus, Know in runtime is Android or IOS

148 views Asked by At

In Genexus, how to know if is compiling for Android or IOS in Smart Device?

Example:

A procedure:

If platform = ‘IOS’
   &Variavel = 1
Else if platform = ‘ANDROID’
   &VARIAVEL = 2
endif
1

There are 1 answers

1
Marcos Crispino On BEST ANSWER

There is no way to know at complie time, but you can check in runtime.

You can use the DeviceType property in ClientInformation

&deviceType = ClientInformation.DeviceType
if &deviceType = SmartDeviceType.iOS
    &variavel = 1
else // if &deviceType = SmartDeviceType.Android
    &variavel = 2
endif

See more info in the official documentation: ClientInformation external object