# One android test device, two different resolutions bug?

**URL:** <https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117>\
**Category:** Bugs\
**Created:** [August 7, 2026, 12:57am UTC](https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117 "2026-08-07T00:57:51Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [August 7, 2026, 12:57am UTC](https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117/1 "2026-08-07T00:57:51Z")

</div>

Hello,

I am facing a very frustrating issue with my game.

I set a dummy app to match the display info of my game. I build contentless debug builds for both apps.

When I run the dummy app AND my app in dummy apps bundle, I get these dimensions:

// Width / Height Density: 3.0

DEBUG:SCRIPT: DIMS: 1136 640 , 2400 1080

and when I run both apps in my game’s bundle, I get these dimensions:

// Width / Height Density: 2.25

DEBUG:SCRIPT: DIMS: 1136 640 , 1800 810

For the life of me, I cannot figure out why this is happening. It is affecting my Banner Ads as the banner dimensions returned are incorrect.

---

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [August 8, 2026, 7:20pm UTC](https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117/2 "2026-08-08T19:20:21Z")

</div>

I also wanted to mention that this issue happens on all the android devices I load the debug apps on. I am testing on Samsung and LG devices. All produce similar resolution differences.

This might add more context. This is how I retrieve the size information. So the window size is what appears to be the value that is causing me issues.

````lua

data.screenWidth, data.screenHeight = sys.get_config_number("display.width"), sys.get_config_number("display.height") 	
	data.windowWidth, data.windowHeight = window.get_size() 
print ("DIMS: ", data.screenWidth, data.screenHeight, data.windowWidth, data.windowHeight)
```

````

---

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [August 12, 2026, 11:48pm UTC](https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117/3 "2026-08-12T23:48:18Z")

</div>

Okay. After 3+ days of research, stripping down my folder structure, string libraries, etc, I have found the only thing that actually makes my game change from the correct resolution numbers to the broken numbers.

My package name affects what is happening and I don’t know why.

my package name is something like `com.xxx.shiboriLand`.

If I run the game, the `window.get_size()` code is incorrect.

if I change the package name to anything else or or even `com.xxx.shiboriLan`, `window.get_size()` behaves correctly. What can be causing this issue?

Is it because my game is already active on google play store and old data is automatically loaded and used?

These are the packages I use:

```lua
dependencies#0 = https://github.com/subsoap/defsave/archive/refs/tags/v1.2.6.zip
dependencies#1 = https://github.com/defold/extension-iap/archive/refs/tags/8.4.0.zip
dependencies#2 = https://github.com/defold/extension-gpgs/archive/refs/tags/5.0.0.zip
https://github.com/AGulev/DefVideoAds/archive/refs/tags/4.19.2.zip

```

@AGulev@britzl , sorry to tag and bother you but I am hoping that maybe your expertise can be of help.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [August 13, 2026, 6:31am UTC](https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117/4 "2026-08-13T06:31:28Z")

</div>

please take a look [https://developer.android.com/games/optimize/adpf/gamemode/gamemode-interventions](https://developer.android.com/games/optimize/adpf/gamemode/gamemode-interventions)

Android may apply downscale to the app (it based on package name)

---

<div class="post-metadata">

**Author:** ![britzl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/britzl/32/23_2.png) [@britzl](https://forum.defold.com/u/britzl)\
**Post date:** [August 13, 2026, 6:33am UTC](https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117/5 "2026-08-13T06:33:11Z")

</div>

I honestly don’t know what’s going on either. I’m also not entirely sure I understand exactly what it is you are testing.

> [@Jay\_Cee](#):
>
> I build contentless debug builds for both apps.

Is this a requirement for the problem to occur?

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [August 13, 2026, 6:41am UTC](https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117/6 "2026-08-13T06:41:50Z")

</div>

> [@Jay\_Cee](#):
>
> For the life of me, I cannot figure out why this is happening. It is affecting my Banner Ads as the banner dimensions returned are incorrect.

Banner dimensions returned by the extension are in Defold screen-space pixels, matching `window.get_size()`. You do not need to apply Android density or compensate for the 75% downscaling. If you need to move a GUI node by the banner height, either use `gui.get_screen_position()`/`gui.set_screen_position()` directly, or convert the screen-space distance to the node’s local coordinates using `gui.screen_to_local()`. This also handles the node’s parents, anchors, adjust mode, and current GUI layout.

---

<div class="post-metadata">

**Author:** ![AGulev](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/agulev/32/4541_2.png) [@AGulev](https://forum.defold.com/u/AGulev)\
**Post date:** [August 13, 2026, 6:48am UTC](https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117/7 "2026-08-13T06:48:01Z")

</div>

These values:

```lua
sys.get_config_number("display.width")
sys.get_config_number("display.height")

```

are the logical resolution configured in `game.project`  
in your case `1136 × 640`. They do not report the device’s physical resolution.

`window.get_size()` returns the rendering surface Android provides to Defold.

Android and device manufacturers can apply Game Mode optimizations per package. This explains why changing only the package name changes the result.

You can check for package-specific settings using:

```sh
adb shell device_config get game_overlay com.xxx.shiboriLand
adb shell dumpsys platform_compat

```

In the second output, look for your package name and these Android compatibility changes:

```plaintext
DOWNSCALED 168419799
DOWNSCALE_75 189969779

```

Also check whether the device’s Game Booster or Game Mode has a resolution or battery-saving option enabled for this game.

**Banners** : the extension returns the banner dimensions in Defold screen-space pixels, matching the coordinate system used by `window.get_size()`. **You should not apply the Android density or the `0.75` factor yourself.**

If you want to move a GUI node by the banner height, you can work directly in screen space:

```lua
local node = gui.get_node("content")
local position = gui.get_screen_position(node)

position.y = position.y + message.height

gui.set_screen_position(node, position)

```

If you need the banner height in the node’s local coordinate system. For example, to resize a node or use `gui.set_position()`—convert the screen-space distance using `gui.screen_to_local()`:

```lua
local function screen_height_to_local(node, screen_height)
    local p0 = gui.screen_to_local(node, vmath.vector3(0, 0, 0))
    local p1 = gui.screen_to_local(node, vmath.vector3(0, screen_height, 0))
    return p1.y - p0.y
end

local node = gui.get_node("content")
local banner_height = screen_height_to_local(node, message.height)

local position = gui.get_position(node)
position.y = position.y + banner_height
gui.set_position(node, position)

```

This conversion takes the node’s parents, anchors, adjust mode, and current GUI layout into account.

**In short** , it doesn’t matter what Android returns. You just need to convert values from screen (window) space into GUI space. For that, it doesn’t matter exactly which values you get; you just need to know which space they are in.

---

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [August 13, 2026, 10:12am UTC](https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117/8 "2026-08-13T10:12:14Z")

</div>

Thank you, and yes, the banner code works perfectly. I suppose it should have been worded differently.

Due to the res scaling, I suppose, the banner adjustment calculations i use is in correct.

For instave, I divide window\_height by game.project\_height. That value is then multiplied by the banner height (320x50).

I then adjust my top bar gui by this value. With the package name change, it works flawlessly. But my game must be getting down scaled.

---

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [August 13, 2026, 9:08pm UTC](https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117/9 "2026-08-13T21:08:12Z")

</div>

> [@britzl](#):
>
> Is this a requirement for the problem to occur?

No it is not. I am simply testing the functionality and Ads support. I believe @AGulev may have hit on what is happening to my project. I will have to figure it all out with the information provided.

---

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [August 13, 2026, 9:12pm UTC](https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117/10 "2026-08-13T21:12:54Z")

</div>

This is an awesome response. I truly appreciate all the help you and the Defold team have provided me.

Thank you very much.

---

<div class="post-metadata">

**Author:** ![Jay\_Cee](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/jay_cee/32/34527_2.png) [@Jay\_Cee](https://forum.defold.com/u/Jay_Cee)\
**Post date:** [August 18, 2026, 12:40am UTC](https://forum.defold.com/t/one-android-test-device-two-different-resolutions-bug/83117/11 "2026-08-18T00:40:41Z")

</div>

Well, I guess I am back to the drawing board.

Maybe I need to just remove the banners all together. Nothing is working and my device is not using ny downscaled resolution as far as test and adb go.

Update: I tried a different (LG) device and it works fine. But my samsung device produces the below image.

 ![Screenshot_20260817_203448](https://forum-defold-uploads.b-cdn.net/original/3X/3/0/307e6d1b55515b82566bfb74b0ea16b9827c1b16.jpeg)
