Corona Ads and Scaling

Hi,

I am testing the new Corona Ads and I am using the code directly from the documentation example. This is my first attempt at implementing ads and the ads are showing up correctly. However, it doesn’t seem that these ads are scaling when using “letterbox” in the config.lua. The ads appear to remain at a “real” 320x50 instead of scaling to fit. Is this the correct behavior? Do the other ad plugins do this as well?

Thanks,

Scott

Couple screenshots showing this…

Samsung Galaxy S4 phone which seems to display correctly.

http://www.lunarmobilesolutions.com/cjbb/Galaxy%20S4.png

Samsung Galaxy Tab A tablet which doesn’t seem to scale.

http://www.lunarmobilesolutions.com/cjbb/Galaxy%20Tab%20A.png

Can anyone who is using Corona Ads either confirm or deny that banner ads are scaling properly for you when using scale = “letterBox” in the config.lua? Or, can you confirm that the ad plugin/network that you currently use (not Corona Ads) scales correctly using “letterbox”? Just trying to find a banner ad solution that scales correctly.

Thanks ahead of time!

Looking at the two screen shots, I would guess the first one is actually wrong. That ad looks way bigger than 320x50 in your content area. Also the rest of the app is scaled up as well.

Can you post your config.lua?

application = { content =  {       width = 320,       height = 480,       scale = "letterBox",       fps = 30,       imageSuffix =        {           ["@2x"] = 2, } }, notification =      {   iphone =         {             types = { "badge", "sound", "alert" }         },         google =         {             projectNumber = "1234567890"         }     },     license =     {         google =         {             key = "BOGUSKEY",         }     },     }

Everything there looks file. “letterBox” should be “letterbox”, but the system makes either work, so it’s not a cause of the issue.

You could put in some print statements in your code to dump out all of the sizing values:

display.contentWidth

display.pixelWidth

display.actualContentWidth (and their height variants)

display.contentScaleX

display.contentScaleY

display.screenOriginX

display.screenOriginY

display.statusBarHeight

display.topStatusBarContentHeight

display.viewableContentHeight

display.viewableContentWidth

And see how the two devices compare. There is also additional screen information in system.getInfo().  There are several AndroidDisplay values you can look at as well. Perhaps we may discover what’s different between the two.

Rob

Rob,

Below is a small sample app, config.lua, build.settings and output from two devices that show the scaling issue that I am seeing. Note the gray box that I display behind the ads that are 320x50 and how the ads do not scale to fit those boxes using “letterbox”.

Any help is greatly appreciated!

Scott

MAIN.LUA display.setStatusBar( display.HiddenStatusBar ) local util = require("Utility") -- setup Corona Ads coronaAds = require( "plugin.coronaAds" ) coronaAdsKey = "5223c2c3-cf81-4c43-ae41-2d4ed16552bc"      -- Corona's test account bannerPlacement = "bottom-banner-320x50" -- listener for Corona Ads function coronaAdsListener( event )     print("coronaAdsListener", event.phase)     util:print\_r(event)     if event.phase == "init" then         coronaAds.show(bannerPlacement, false)     end     end print("Device Model = ", system.getInfo("model")) print("Platform Name = ", system.getInfo("platformName")) print("Platform Version = ", system.getInfo("platformVersion")) print("Corona Version = ", system.getInfo("version")) print("Corona Build = ", system.getInfo("build")) print("display.contentWidth", display.contentWidth) print("display.contentHeight", display.contentHeight) print("display.pixelWidth", display.pixelWidth) print("display.pixelHeight", display.pixelHeight) print("display.actualContentWidth", display.actualContentWidth) print("display.actualContentHeight", display.actualContentHeight) print("display.contentScaleX", display.contentScaleX) print("display.contentScaleY", display.contentScaleY) print("display.screenOriginX", display.screenOriginX) print("display.screenOriginY", display.screenOriginY) print("display.statusBarHeight", display.statusBarHeight) print("display.topStatusBarContentHeight", display.topStatusBarContentHeight) print("display.viewableContentHeight", display.viewableContentHeight) print("display.viewableContentWidth", display.viewableContentWidth) topDiff = (display.actualContentHeight - display.contentHeight) \* .5 local adSpace = display.newRect( 0, 0, 320, 50 ) adSpace.anchorX = .5 adSpace.anchorY = 1 adSpace.x = display.contentWidth \* .5 adSpace.y = display.actualContentHeight - topDiff adSpace:setFillColor( .5, .5, .5 ) local adText = display.newText( "320 x 50", 0, 0, native.systemFont, 14 ) adText.anchorX = .5 adText.anchorY = .5 adText.x = display.contentWidth \* .5 adText.y = display.actualContentHeight - topDiff - 40 adText:setTextColor( 1, 1, 1 ) print("initialize Corona Ads with key: ", coronaAdsKey) coronaAds.init( coronaAdsKey, coronaAdsListener ) CONFIG.LUA application = {     content =     {           width = 320,           height = 480,           scale = "letterbox",           fps = 30,     }, } BUILD.SETTINGS settings = {     build =     {         neverStripDebugInfo = true     },     plugins =     {          ["plugin.google.play.services"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { android=true }         },         ["shared.android.support.v4"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { android=true }         },         ["plugin.coronaAds"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { iphone=true, android=true }         },      },     orientation =     {         default = "portrait",         supported =         {             "portrait",         }     },     android =     {         usesPermissions =         {             "android.permission.INTERNET"         },     },             iphone =     {         plist=         {            -- Whitelist Facebook Servers for Network Requests             NSAppTransportSecurity =             {                 NSAllowsArbitraryLoads = true             },             CFBundleDisplayName = "Crackerjack Baseball",             NSLocationAlwaysUsageDescription = { "" },             NSLocationWhenInUseUsageDescription = { "" },         },     }, }

Here is the output for the above code for a Samsung Galaxy S4 Smartphone

Galaxy S4 screenshot here

I/Corona  (15186): Device Model =       SCH-I545
I/Corona  (15186): Platform Name =      Android
I/Corona  (15186): Platform Version =   4.4.2
I/Corona  (15186): Corona Version =     3.0.0
I/Corona  (15186): Corona Build =       2016.2948
I/Corona  (15186): display.contentWidth 320
I/Corona  (15186): display.contentHeight        480
I/Corona  (15186): display.pixelWidth   1080
I/Corona  (15186): display.pixelHeight  1920
I/Corona  (15186): display.actualContentWidth   320
I/Corona  (15186): display.actualContentHeight  568.88891601562
I/Corona  (15186): display.contentScaleX        0.29629629850388
I/Corona  (15186): display.contentScaleY        0.29629629850388
I/Corona  (15186): display.screenOriginX        0
I/Corona  (15186): display.screenOriginY        -44
I/Corona  (15186): display.statusBarHeight      75
I/Corona  (15186): display.topStatusBarContentHeight    22.22222328186
I/Corona  (15186): display.viewableContentHeight        480
I/Corona  (15186): display.viewableContentWidth 320
I/Corona  (15186): initialize Corona Ads with key:      5223c2c3-cf81-4c43-ae41-2d4ed16552bc
I/Corona  (15186): [Lua::RuntimeDispatchEvent()] WARNING: This function is deprecated. Use Lua::DispatchRuntimeEvent() instead.
I/Corona  (15186): coronaAdsListener    init
I/Corona  (15186): print_r
I/Corona  (15186): table: 0x7b709b88 {
I/Corona  (15186):   [provider] => “coronaAds”
I/Corona  (15186):   [name] => “adsRequest”
I/Corona  (15186):   [phase] => “init”
I/Corona  (15186): }
I/Corona  (15186): coronaAdsListener    request
I/Corona  (15186): print_r
I/Corona  (15186): table: 0x7b839178 {
I/Corona  (15186):   [placementId] => “bottom-banner-320x50”
I/Corona  (15186):   [isError] => false
I/Corona  (15186):   [phase] => “request”
I/Corona  (15186):   [provider] => “coronaAds”
I/Corona  (15186):   [name] => “adsRequest”
I/Corona  (15186): }
I/Corona  (15186): coronaAdsListener    found
I/Corona  (15186): print_r
I/Corona  (15186): table: 0x7b8c08d0 {
I/Corona  (15186):   [placementId] => “bottom-banner-320x50”
I/Corona  (15186):   [identifier] => “990039427ce2db0248f707fac9bdb7ad12d1a9609a396ac93715fe2133aa62df”
I/Corona  (15186):   [isError] => false
I/Corona  (15186):   [phase] => “found”
I/Corona  (15186):   [network] => “”
I/Corona  (15186):   [provider] => “coronaAds”
I/Corona  (15186):   [name] => “adsRequest”
I/Corona  (15186): }
I/Corona  (15186): coronaAdsListener    shown
I/Corona  (15186): print_r
I/Corona  (15186): table: 0x7e8cb9b0 {
I/Corona  (15186):   [placementId] => “bottom-banner-320x50”
I/Corona  (15186):   [identifier] => “990039427ce2db0248f707fac9bdb7ad12d1a9609a396ac93715fe2133aa62df”
I/Corona  (15186):   [isError] => false
I/Corona  (15186):   [phase] => “shown”
I/Corona  (15186):   [network] => “”
I/Corona  (15186):   [provider] => “coronaAds”
I/Corona  (15186):   [name] => “adsRequest”
I/Corona  (15186): }

Here is the output for the above code for a Samsung Galaxy Tab A Tablet

Galaxy Tab A screenshot here

09-27 16:54:50.379 21045 21070 I Corona  : Device Model =       SM-T550
09-27 16:54:50.379 21045 21070 I Corona  : Platform Name =      Android
09-27 16:54:50.379 21045 21070 I Corona  : Platform Version =   6.0.1
09-27 16:54:50.379 21045 21070 I Corona  : Corona Version =     3.0.0
09-27 16:54:50.379 21045 21070 I Corona  : Corona Build =       2016.2948
09-27 16:54:50.379 21045 21070 I Corona  : display.contentWidth 320
09-27 16:54:50.379 21045 21070 I Corona  : display.contentHeight        480
09-27 16:54:50.379 21045 21070 I Corona  : display.pixelWidth   768
09-27 16:54:50.379 21045 21070 I Corona  : display.pixelHeight  1024
09-27 16:54:50.379 21045 21070 I Corona  : display.actualContentWidth   360
09-27 16:54:50.379 21045 21070 I Corona  : display.actualContentHeight  480
09-27 16:54:50.379 21045 21070 I Corona  : display.contentScaleX        0.46875
09-27 16:54:50.379 21045 21070 I Corona  : display.contentScaleY        0.46875
09-27 16:54:50.379 21045 21070 I Corona  : display.screenOriginX        -20
09-27 16:54:50.379 21045 21070 I Corona  : display.screenOriginY        -0
09-27 16:54:50.379 21045 21070 I Corona  : display.statusBarHeight      24
09-27 16:54:50.389 21045 21070 I Corona  : display.topStatusBarContentHeight    11.25
09-27 16:54:50.389 21045 21070 I Corona  : display.viewableContentHeight        480
09-27 16:54:50.389 21045 21070 I Corona  : display.viewableContentWidth 320
09-27 16:54:50.399 21045 21070 I Corona  : initialize Corona Ads with key:      5223c2c3-cf81-4c43-ae41-2d4ed16552bc
09-27 16:54:50.439 21045 21070 I Corona  : [Lua::RuntimeDispatchEvent()] WARNING: This function is deprecated. Use Lua::DispatchRuntimeEvent() instead.
09-27 16:54:52.149 21045 21070 I Corona  : coronaAdsListener    init
09-27 16:54:52.149 21045 21070 I Corona  : print_r
09-27 16:54:52.159 21045 21070 I Corona  : table: 0xb9405a80 {
09-27 16:54:52.159 21045 21070 I Corona  :   [provider] => “coronaAds”
09-27 16:54:52.159 21045 21070 I Corona  :   [name] => “adsRequest”
09-27 16:54:52.159 21045 21070 I Corona  :   [phase] => “init”
09-27 16:54:52.159 21045 21070 I Corona  : }
09-27 16:54:52.459 21045 21070 I Corona  : coronaAdsListener    request
09-27 16:54:52.459 21045 21070 I Corona  : print_r
09-27 16:54:52.459 21045 21070 I Corona  : table: 0xb94f1220 {
09-27 16:54:52.459 21045 21070 I Corona  :   [placementId] => “bottom-banner-320x50”
09-27 16:54:52.459 21045 21070 I Corona  :   [isError] => false
09-27 16:54:52.459 21045 21070 I Corona  :   [phase] => “request”
09-27 16:54:52.459 21045 21070 I Corona  :   [provider] => “coronaAds”
09-27 16:54:52.459 21045 21070 I Corona  :   [name] => “adsRequest”
09-27 16:54:52.459 21045 21070 I Corona  : }
09-27 16:54:55.609 21045 21070 I Corona  : coronaAdsListener    found
09-27 16:54:55.609 21045 21070 I Corona  : print_r
09-27 16:54:55.609 21045 21070 I Corona  : table: 0xb9720878 {
09-27 16:54:55.609 21045 21070 I Corona  :   [placementId] => “bottom-banner-320x50”
09-27 16:54:55.609 21045 21070 I Corona  :   [identifier] => “990039427ce2db0248f707fac9bdb7ad12d1a9609a396ac93715fe2133aa62df”
09-27 16:54:55.609 21045 21070 I Corona  :   [isError] => false
09-27 16:54:55.609 21045 21070 I Corona  :   [phase] => “found”
09-27 16:54:55.609 21045 21070 I Corona  :   [network] => “”
09-27 16:54:55.609 21045 21070 I Corona  :   [provider] => “coronaAds”
09-27 16:54:55.609 21045 21070 I Corona  :   [name] => “adsRequest”
09-27 16:54:55.609 21045 21070 I Corona  : }
09-27 16:54:55.609 21045 21070 I Corona  : coronaAdsListener    shown
09-27 16:54:55.609 21045 21070 I Corona  : print_r
09-27 16:54:55.609 21045 21070 I Corona  : table: 0xb96f5dd0 {
09-27 16:54:55.609 21045 21070 I Corona  :   [placementId] => “bottom-banner-320x50”
09-27 16:54:55.609 21045 21070 I Corona  :   [identifier] => “990039427ce2db0248f707fac9bdb7ad12d1a9609a396ac93715fe2133aa62df”
09-27 16:54:55.609 21045 21070 I Corona  :   [isError] => false
09-27 16:54:55.609 21045 21070 I Corona  :   [phase] => “shown”
09-27 16:54:55.609 21045 21070 I Corona  :   [network] => “”
09-27 16:54:55.609 21045 21070 I Corona  :   [provider] => “coronaAds”
09-27 16:54:55.609 21045 21070 I Corona  :   [name] => “adsRequest”
09-27 16:54:55.609 21045 21070 I Corona  : }

Look at this API:  https://docs.coronalabs.com/api/library/system/getInfo.html#androiddisplayapproximatedpi

There are six different options to pass to system.getInfo() that will get the device’s DPI information. Can you print those out as well?

Rob

Hi Rob,

Here is the output:

TabA

I Corona  : androidDisplayApproximateDpi 160
I Corona  : androidDisplayDensityName    mdpi
I Corona  : androidDisplayWidthInInches  5.8267898992958
I Corona  : androidDisplayHeightInInches 7.7559305673552
I Corona  : androidDisplayXDpi   131.80499267578
I Corona  : androidDisplayYDpi   132.02799987793

 

S4

I/Corona  ( 8849): androidDisplayApproximateDpi 480
I/Corona  ( 8849): androidDisplayDensityName    xxhdpi
I/Corona  ( 8849): androidDisplayWidthInInches  2.4409483251546
I/Corona  ( 8849): androidDisplayHeightInInches 4.3700821038
I/Corona  ( 8849): androidDisplayXDpi   442.45098876953
I/Corona  ( 8849): androidDisplayYDpi   439.35101318359

 

I’m trying to get our engineers to look into this. I was hoping something obvious would show up. I know some Android devices don’t report proper values for the DPI information which can lead to scaling problems but that doesn’t seem to be the case here.e

Rob

Thanks Rob

If it helps, I’m seeing the same issue with iOS. Below is the output and screenshot from an iPad 4

iPad 4 screenshot here

Device Model = iPad

Platform Name = iPhone OS

Platform Version = 9.3.4

Corona Version = 3.0.0

Corona Build = 2016.2951

display.contentWidth 320

display.contentHeight 480

display.pixelWidth 1536

display.pixelHeight 2048

display.actualContentWidth 360

display.actualContentHeight 480

display.contentScaleX 0.234375

display.contentScaleY 0.234375

display.screenOriginX -20

display.screenOriginY -0

display.statusBarHeight 20

display.topStatusBarContentHeight 0

display.viewableContentHeight 480

display.viewableContentWidth 320

initialize Corona Ads with key: 5223c2c3-cf81-4c43-ae41-2d4ed16552bc

coronaAdsListener init

print_r

table: 0x17620800 {

  [phase] => “init”

   [provider] => “coronaAds”

   [isError] => false

   [name] => “corona_ads_event”

}

coronaAdsListener request

print_r

table: 0x17626e40 {

   [placementId] => “bottom-banner-320x50”

   [name] => “corona_ads_event”

   [phase] => “request”

   [provider] => “coronaAds”

   [isError] => false

 }

coronaAdsListener found

print_r

table: 0x175c27a0 {

   [placementId] => “bottom-banner-320x50”

   [identifier] => “s2sAdvert”

   [isError] => false

   [phase] => “found”

   [provider] => “coronaAds”

   [name] => “corona_ads_event”

}

coronaAdsListener shown

print_r

table: 0x175b9540 {

   [placementId] => “bottom-banner-320x50”

   [identifier] => “s2sAdvert”

   [isError] => false

   [phase] => “shown”

   [provider] => “coronaAds”

   [name] => “corona_ads_event”

}

Interesting. It’s like it’s detecting a tablet and delivering an ad scaled to the tablet, not to the content area. I’ll update the engineers.

Rob

Couple screenshots showing this…

Samsung Galaxy S4 phone which seems to display correctly.

http://www.lunarmobilesolutions.com/cjbb/Galaxy%20S4.png

Samsung Galaxy Tab A tablet which doesn’t seem to scale.

http://www.lunarmobilesolutions.com/cjbb/Galaxy%20Tab%20A.png

Can anyone who is using Corona Ads either confirm or deny that banner ads are scaling properly for you when using scale = “letterBox” in the config.lua? Or, can you confirm that the ad plugin/network that you currently use (not Corona Ads) scales correctly using “letterbox”? Just trying to find a banner ad solution that scales correctly.

Thanks ahead of time!

Looking at the two screen shots, I would guess the first one is actually wrong. That ad looks way bigger than 320x50 in your content area. Also the rest of the app is scaled up as well.

Can you post your config.lua?

application = { content =  {       width = 320,       height = 480,       scale = "letterBox",       fps = 30,       imageSuffix =        {           ["@2x"] = 2, } }, notification =      {   iphone =         {             types = { "badge", "sound", "alert" }         },         google =         {             projectNumber = "1234567890"         }     },     license =     {         google =         {             key = "BOGUSKEY",         }     },     }

Everything there looks file. “letterBox” should be “letterbox”, but the system makes either work, so it’s not a cause of the issue.

You could put in some print statements in your code to dump out all of the sizing values:

display.contentWidth

display.pixelWidth

display.actualContentWidth (and their height variants)

display.contentScaleX

display.contentScaleY

display.screenOriginX

display.screenOriginY

display.statusBarHeight

display.topStatusBarContentHeight

display.viewableContentHeight

display.viewableContentWidth

And see how the two devices compare. There is also additional screen information in system.getInfo().  There are several AndroidDisplay values you can look at as well. Perhaps we may discover what’s different between the two.

Rob

Rob,

Below is a small sample app, config.lua, build.settings and output from two devices that show the scaling issue that I am seeing. Note the gray box that I display behind the ads that are 320x50 and how the ads do not scale to fit those boxes using “letterbox”.

Any help is greatly appreciated!

Scott

MAIN.LUA display.setStatusBar( display.HiddenStatusBar ) local util = require("Utility") -- setup Corona Ads coronaAds = require( "plugin.coronaAds" ) coronaAdsKey = "5223c2c3-cf81-4c43-ae41-2d4ed16552bc"      -- Corona's test account bannerPlacement = "bottom-banner-320x50" -- listener for Corona Ads function coronaAdsListener( event )     print("coronaAdsListener", event.phase)     util:print\_r(event)     if event.phase == "init" then         coronaAds.show(bannerPlacement, false)     end     end print("Device Model = ", system.getInfo("model")) print("Platform Name = ", system.getInfo("platformName")) print("Platform Version = ", system.getInfo("platformVersion")) print("Corona Version = ", system.getInfo("version")) print("Corona Build = ", system.getInfo("build")) print("display.contentWidth", display.contentWidth) print("display.contentHeight", display.contentHeight) print("display.pixelWidth", display.pixelWidth) print("display.pixelHeight", display.pixelHeight) print("display.actualContentWidth", display.actualContentWidth) print("display.actualContentHeight", display.actualContentHeight) print("display.contentScaleX", display.contentScaleX) print("display.contentScaleY", display.contentScaleY) print("display.screenOriginX", display.screenOriginX) print("display.screenOriginY", display.screenOriginY) print("display.statusBarHeight", display.statusBarHeight) print("display.topStatusBarContentHeight", display.topStatusBarContentHeight) print("display.viewableContentHeight", display.viewableContentHeight) print("display.viewableContentWidth", display.viewableContentWidth) topDiff = (display.actualContentHeight - display.contentHeight) \* .5 local adSpace = display.newRect( 0, 0, 320, 50 ) adSpace.anchorX = .5 adSpace.anchorY = 1 adSpace.x = display.contentWidth \* .5 adSpace.y = display.actualContentHeight - topDiff adSpace:setFillColor( .5, .5, .5 ) local adText = display.newText( "320 x 50", 0, 0, native.systemFont, 14 ) adText.anchorX = .5 adText.anchorY = .5 adText.x = display.contentWidth \* .5 adText.y = display.actualContentHeight - topDiff - 40 adText:setTextColor( 1, 1, 1 ) print("initialize Corona Ads with key: ", coronaAdsKey) coronaAds.init( coronaAdsKey, coronaAdsListener ) CONFIG.LUA application = {     content =     {           width = 320,           height = 480,           scale = "letterbox",           fps = 30,     }, } BUILD.SETTINGS settings = {     build =     {         neverStripDebugInfo = true     },     plugins =     {          ["plugin.google.play.services"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { android=true }         },         ["shared.android.support.v4"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { android=true }         },         ["plugin.coronaAds"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { iphone=true, android=true }         },      },     orientation =     {         default = "portrait",         supported =         {             "portrait",         }     },     android =     {         usesPermissions =         {             "android.permission.INTERNET"         },     },             iphone =     {         plist=         {            -- Whitelist Facebook Servers for Network Requests             NSAppTransportSecurity =             {                 NSAllowsArbitraryLoads = true             },             CFBundleDisplayName = "Crackerjack Baseball",             NSLocationAlwaysUsageDescription = { "" },             NSLocationWhenInUseUsageDescription = { "" },         },     }, }

Here is the output for the above code for a Samsung Galaxy S4 Smartphone

Galaxy S4 screenshot here

I/Corona  (15186): Device Model =       SCH-I545
I/Corona  (15186): Platform Name =      Android
I/Corona  (15186): Platform Version =   4.4.2
I/Corona  (15186): Corona Version =     3.0.0
I/Corona  (15186): Corona Build =       2016.2948
I/Corona  (15186): display.contentWidth 320
I/Corona  (15186): display.contentHeight        480
I/Corona  (15186): display.pixelWidth   1080
I/Corona  (15186): display.pixelHeight  1920
I/Corona  (15186): display.actualContentWidth   320
I/Corona  (15186): display.actualContentHeight  568.88891601562
I/Corona  (15186): display.contentScaleX        0.29629629850388
I/Corona  (15186): display.contentScaleY        0.29629629850388
I/Corona  (15186): display.screenOriginX        0
I/Corona  (15186): display.screenOriginY        -44
I/Corona  (15186): display.statusBarHeight      75
I/Corona  (15186): display.topStatusBarContentHeight    22.22222328186
I/Corona  (15186): display.viewableContentHeight        480
I/Corona  (15186): display.viewableContentWidth 320
I/Corona  (15186): initialize Corona Ads with key:      5223c2c3-cf81-4c43-ae41-2d4ed16552bc
I/Corona  (15186): [Lua::RuntimeDispatchEvent()] WARNING: This function is deprecated. Use Lua::DispatchRuntimeEvent() instead.
I/Corona  (15186): coronaAdsListener    init
I/Corona  (15186): print_r
I/Corona  (15186): table: 0x7b709b88 {
I/Corona  (15186):   [provider] => “coronaAds”
I/Corona  (15186):   [name] => “adsRequest”
I/Corona  (15186):   [phase] => “init”
I/Corona  (15186): }
I/Corona  (15186): coronaAdsListener    request
I/Corona  (15186): print_r
I/Corona  (15186): table: 0x7b839178 {
I/Corona  (15186):   [placementId] => “bottom-banner-320x50”
I/Corona  (15186):   [isError] => false
I/Corona  (15186):   [phase] => “request”
I/Corona  (15186):   [provider] => “coronaAds”
I/Corona  (15186):   [name] => “adsRequest”
I/Corona  (15186): }
I/Corona  (15186): coronaAdsListener    found
I/Corona  (15186): print_r
I/Corona  (15186): table: 0x7b8c08d0 {
I/Corona  (15186):   [placementId] => “bottom-banner-320x50”
I/Corona  (15186):   [identifier] => “990039427ce2db0248f707fac9bdb7ad12d1a9609a396ac93715fe2133aa62df”
I/Corona  (15186):   [isError] => false
I/Corona  (15186):   [phase] => “found”
I/Corona  (15186):   [network] => “”
I/Corona  (15186):   [provider] => “coronaAds”
I/Corona  (15186):   [name] => “adsRequest”
I/Corona  (15186): }
I/Corona  (15186): coronaAdsListener    shown
I/Corona  (15186): print_r
I/Corona  (15186): table: 0x7e8cb9b0 {
I/Corona  (15186):   [placementId] => “bottom-banner-320x50”
I/Corona  (15186):   [identifier] => “990039427ce2db0248f707fac9bdb7ad12d1a9609a396ac93715fe2133aa62df”
I/Corona  (15186):   [isError] => false
I/Corona  (15186):   [phase] => “shown”
I/Corona  (15186):   [network] => “”
I/Corona  (15186):   [provider] => “coronaAds”
I/Corona  (15186):   [name] => “adsRequest”
I/Corona  (15186): }

Here is the output for the above code for a Samsung Galaxy Tab A Tablet

Galaxy Tab A screenshot here

09-27 16:54:50.379 21045 21070 I Corona  : Device Model =       SM-T550
09-27 16:54:50.379 21045 21070 I Corona  : Platform Name =      Android
09-27 16:54:50.379 21045 21070 I Corona  : Platform Version =   6.0.1
09-27 16:54:50.379 21045 21070 I Corona  : Corona Version =     3.0.0
09-27 16:54:50.379 21045 21070 I Corona  : Corona Build =       2016.2948
09-27 16:54:50.379 21045 21070 I Corona  : display.contentWidth 320
09-27 16:54:50.379 21045 21070 I Corona  : display.contentHeight        480
09-27 16:54:50.379 21045 21070 I Corona  : display.pixelWidth   768
09-27 16:54:50.379 21045 21070 I Corona  : display.pixelHeight  1024
09-27 16:54:50.379 21045 21070 I Corona  : display.actualContentWidth   360
09-27 16:54:50.379 21045 21070 I Corona  : display.actualContentHeight  480
09-27 16:54:50.379 21045 21070 I Corona  : display.contentScaleX        0.46875
09-27 16:54:50.379 21045 21070 I Corona  : display.contentScaleY        0.46875
09-27 16:54:50.379 21045 21070 I Corona  : display.screenOriginX        -20
09-27 16:54:50.379 21045 21070 I Corona  : display.screenOriginY        -0
09-27 16:54:50.379 21045 21070 I Corona  : display.statusBarHeight      24
09-27 16:54:50.389 21045 21070 I Corona  : display.topStatusBarContentHeight    11.25
09-27 16:54:50.389 21045 21070 I Corona  : display.viewableContentHeight        480
09-27 16:54:50.389 21045 21070 I Corona  : display.viewableContentWidth 320
09-27 16:54:50.399 21045 21070 I Corona  : initialize Corona Ads with key:      5223c2c3-cf81-4c43-ae41-2d4ed16552bc
09-27 16:54:50.439 21045 21070 I Corona  : [Lua::RuntimeDispatchEvent()] WARNING: This function is deprecated. Use Lua::DispatchRuntimeEvent() instead.
09-27 16:54:52.149 21045 21070 I Corona  : coronaAdsListener    init
09-27 16:54:52.149 21045 21070 I Corona  : print_r
09-27 16:54:52.159 21045 21070 I Corona  : table: 0xb9405a80 {
09-27 16:54:52.159 21045 21070 I Corona  :   [provider] => “coronaAds”
09-27 16:54:52.159 21045 21070 I Corona  :   [name] => “adsRequest”
09-27 16:54:52.159 21045 21070 I Corona  :   [phase] => “init”
09-27 16:54:52.159 21045 21070 I Corona  : }
09-27 16:54:52.459 21045 21070 I Corona  : coronaAdsListener    request
09-27 16:54:52.459 21045 21070 I Corona  : print_r
09-27 16:54:52.459 21045 21070 I Corona  : table: 0xb94f1220 {
09-27 16:54:52.459 21045 21070 I Corona  :   [placementId] => “bottom-banner-320x50”
09-27 16:54:52.459 21045 21070 I Corona  :   [isError] => false
09-27 16:54:52.459 21045 21070 I Corona  :   [phase] => “request”
09-27 16:54:52.459 21045 21070 I Corona  :   [provider] => “coronaAds”
09-27 16:54:52.459 21045 21070 I Corona  :   [name] => “adsRequest”
09-27 16:54:52.459 21045 21070 I Corona  : }
09-27 16:54:55.609 21045 21070 I Corona  : coronaAdsListener    found
09-27 16:54:55.609 21045 21070 I Corona  : print_r
09-27 16:54:55.609 21045 21070 I Corona  : table: 0xb9720878 {
09-27 16:54:55.609 21045 21070 I Corona  :   [placementId] => “bottom-banner-320x50”
09-27 16:54:55.609 21045 21070 I Corona  :   [identifier] => “990039427ce2db0248f707fac9bdb7ad12d1a9609a396ac93715fe2133aa62df”
09-27 16:54:55.609 21045 21070 I Corona  :   [isError] => false
09-27 16:54:55.609 21045 21070 I Corona  :   [phase] => “found”
09-27 16:54:55.609 21045 21070 I Corona  :   [network] => “”
09-27 16:54:55.609 21045 21070 I Corona  :   [provider] => “coronaAds”
09-27 16:54:55.609 21045 21070 I Corona  :   [name] => “adsRequest”
09-27 16:54:55.609 21045 21070 I Corona  : }
09-27 16:54:55.609 21045 21070 I Corona  : coronaAdsListener    shown
09-27 16:54:55.609 21045 21070 I Corona  : print_r
09-27 16:54:55.609 21045 21070 I Corona  : table: 0xb96f5dd0 {
09-27 16:54:55.609 21045 21070 I Corona  :   [placementId] => “bottom-banner-320x50”
09-27 16:54:55.609 21045 21070 I Corona  :   [identifier] => “990039427ce2db0248f707fac9bdb7ad12d1a9609a396ac93715fe2133aa62df”
09-27 16:54:55.609 21045 21070 I Corona  :   [isError] => false
09-27 16:54:55.609 21045 21070 I Corona  :   [phase] => “shown”
09-27 16:54:55.609 21045 21070 I Corona  :   [network] => “”
09-27 16:54:55.609 21045 21070 I Corona  :   [provider] => “coronaAds”
09-27 16:54:55.609 21045 21070 I Corona  :   [name] => “adsRequest”
09-27 16:54:55.609 21045 21070 I Corona  : }

Look at this API:  https://docs.coronalabs.com/api/library/system/getInfo.html#androiddisplayapproximatedpi

There are six different options to pass to system.getInfo() that will get the device’s DPI information. Can you print those out as well?

Rob

Hi Rob,

Here is the output:

TabA

I Corona  : androidDisplayApproximateDpi 160
I Corona  : androidDisplayDensityName    mdpi
I Corona  : androidDisplayWidthInInches  5.8267898992958
I Corona  : androidDisplayHeightInInches 7.7559305673552
I Corona  : androidDisplayXDpi   131.80499267578
I Corona  : androidDisplayYDpi   132.02799987793

 

S4

I/Corona  ( 8849): androidDisplayApproximateDpi 480
I/Corona  ( 8849): androidDisplayDensityName    xxhdpi
I/Corona  ( 8849): androidDisplayWidthInInches  2.4409483251546
I/Corona  ( 8849): androidDisplayHeightInInches 4.3700821038
I/Corona  ( 8849): androidDisplayXDpi   442.45098876953
I/Corona  ( 8849): androidDisplayYDpi   439.35101318359