How do you determine what device is being used?

Can someone write the codes that determine what device is being used? I'll give examples:

If I want my game to detect an Android Phone, is the code:

RULE: TEXT EXPRESSION: if "game.Platform.Device_Model" contains "Android"


Would this be correct?


How can I detect an Android with a screen ratio of 21:9 ? like my HONOR X7 android? I see that most phones nowadays have a screen ratio of 21:9... how can I define the screen ratios in code?

Comments

  • ArmellineArmelline Member, PRO Posts: 5,363

    This is increasingly complicated as time goes on and new devices are released. For the screen ratio, you can calculate it with the Device.Screen.Size.Width and Height attributes. Android phones often seem to report that inconsistently, though. Some always show the button bar, some do not. Those that always show it, some include it in the screen size reported, some do not. It's... annoying.

    I plan to do another update to my universalising templates/instructions in the near future. The current ones work for most devices but don't properly handle some of the super-wide AND super-tall Androids like the Fold.

Sign In or Register to comment.