[TIMOB-15437] Android: Titanium.Platform.displayCaps.dpi incorrect for Samsung S4 / Sony Experia Z emulator
GitHub Issue | n/a |
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2013-10-09T22:00:33.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android |
Reporter | Fabiano Taioli (vista) |
Assignee | Ingo Muschenetz |
Created | 2013-09-26T07:54:03.000+0000 |
Updated | 2017-03-29T20:59:49.000+0000 |
Description
I'm testing a simple titanium app on an android avd obtained from a Xperia Z device definition (similar to samsung s4).
The app works but I got a wrong value for Titanium.Platform.displayCaps.dpi
The app report a wrong value for Titanium.Platform.displayCaps.dpi = 320 (avd has a dpi of 480).
If can help finding a solution the Ti.Platform.displayCaps.platformWidth correctly report 1080.
Attached AVD config
Attachments
[~morahman] He isn't using the actual device, he is using an AVD simulator based on the device, you should be able to create a custom simulator based on this to test.
This is a problem on the emulators only. It seems to work fine on the actual device. Googling indicates this is a problem on native applications as well and is a problem with the emulator.
I have no the real device to test but may be really an emulator issue. I was able to force the right DPI values on emulator with this commands: > adb shell setprop qemu.sf.lcd_density 480 > adb shell stop > adb shell start
From the comments, it _sounds_ as if this is an emulator bug, not an issue with the Titanium platform. [~tlsg] do you have any links? Otherwise, can you please provide the following:
Steps you used to create the emulator.
Sample app you used to test the theory
Actual vs. expected results (I'm assuming alert of Titanium.Platform.displayCaps.dpi displays 320,nut browsing the info of the AVD displays 480)
This is SO for the commands Fabino found: http://stackoverflow.com/questions/12919341/any-suggestions-on-getting-xxhdpi-working-in-the-android-emulator This is one of the many places developers were complaining about the wrong dpi: http://www.basic4ppc.com/android/forum/threads/density-for-1080x1920-is-not-correct.29686/ And looking at the code for Ti, the reported dpi is indeed just calling the same underlying android function "context.getResources().getDisplayMetrics().density" so it would make sense that this is an emulator problem.
Based on comments, this appears to not be our bug. Resolving as such.
Closing ticket as it has been established that the issue is not our bug.