hi Rob, thanks for the fast reply.
i only do business apps, that doesnt mean they need to be all the same and bland ;). in this case i use background images.
so if i understood it right, the trick here is to determine the DPI of a device and his actuall real size? seams mission impossible to me…
i found an old post to determine dpi but the list would take forever…
local function getDeviceMetrics( ) -- See: http://en.wikipedia.org/wiki/List\_of\_displays\_by\_pixel\_density local corona\_width = -display.screenOriginX \* 2 + display.contentWidth local corona\_height = -display.screenOriginY \* 2 + display.contentHeight --print("Corona unit width: " .. corona\_width .. ", height: " .. corona\_height) -- I was rounding these, on the theory that they would always round to the correct integer pixel -- size, but I noticed that in practice it rounded to an incorrect size sometimes, so I think it's -- better to use the computed fractional values instead of possibly introducing more error. -- local pixel\_width = corona\_width / display.contentScaleX local pixel\_height = corona\_height / display.contentScaleY --print("Pixel width: " .. pixel\_width .. ", height: " .. pixel\_height) local model = system.getInfo("model") local default\_device = { model = model, inchesDiagonal = 4.0, } -- Approximation (assumes average sized phone) local devices = { { model = "iPhone", inchesDiagonal = 3.5, }, { model = "iPad", inchesDiagonal = 9.7, }, { model = "iPod touch", inchesDiagonal = 3.5, }, { model = "Nexus One", inchesDiagonal = 3.7, }, { model = "Nexus S", inchesDiagonal = 4.0, }, -- Unverified model value { model = "Droid", inchesDiagonal = 3.7, }, { model = "Droid X", inchesDiagonal = 4.3, }, -- Unverified model value { model = "Galaxy Tab", inchesDiagonal = 7.0, }, { model = "Galaxy Tab X", inchesDiagonal = 10.1, }, -- Unverified model value { model = "Kindle Fire", inchesDiagonal = 7.0, }, { model = "Nook Color", inchesDiagonal = 7.0, }, } local device = default\_device for \_, deviceEntry in pairs(devices) do if deviceEntry.model == model then device = deviceEntry end end -- Pixel width, height, and pixels per inch device.pixelWidth = pixel\_width device.pixelHeight = pixel\_height device.ppi = math.sqrt((pixel\_width^2) + (pixel\_height^2)) / device.inchesDiagonal -- Corona unit width, height, and "Corona units per inch" device.coronaWidth = corona\_width device.coronaHeight = corona\_height device.cpi = math.sqrt(corona\_width^2 + corona\_height^2)/device.inchesDiagonal print("Device: " .. device.model .. ", size: " .. device.inchesDiagonal .. " inches, ppi: " .. device.ppi .. ", cpi: " .. device.cpi) return device end
I think i can get dpi from the android using system.getInfo(“androidDisplayApproximateDpi”) but i don’t know the actual size of the device. i know on android i can get that variable using displayMetrics. Corona provides this kinda of info if so my job is pretty much simpler and doable.