How can I write this code so that it will work on the simulator when I switch to different test devices?
Public.isTablet = function() local platform = system.getInfo("platformName") print("platform: ", system.getInfo("platformName")) print("model: ", system.getInfo("model")) print("architectureInfo: ", system.getInfo("architectureInfo")) if (platform == "Android") then return ( system.getInfo( "androidDisplayWidthInInches" ) \> 5 or system.getInfo( "androidDisplayHeightInInches" ) \> 5 ) elseif (platform == "iPhone OS") then -- includes all iOS devices + XCode Simulator return (system.getInfo("model") == "iPad") end return false end
When I’m running this in Windows in the Corona Simulator, it returns the following:
platform: Win
model: Nexus One
architectureInfo: x64
Not very helpful for what I’m trying to do! So how can I determine that this is supposed to be running on an Android?