Open GoogleCodeExporter opened 9 years ago
Original comment by shai.almog
on 24 Feb 2012 at 6:36
Original comment by shai.almog
on 29 Feb 2012 at 3:43
that's strange can you please check on the device what's the output of:
DisplayMetrics metrics = new DisplayMetrics();
activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
System.out.println(metrics.densityDpi);
Original comment by cf27...@gmail.com
on 29 Feb 2012 at 3:55
Yeah that's strange
Output is 240
Original comment by hamed.za...@gmail.com
on 29 Feb 2012 at 4:21
Thanks,
Can you also run this and let me know the result:
DisplayMetrics dm = activity.getResources().getDisplayMetrics();
float screenWidth = dm.widthPixels / dm.xdpi;
float screenHeight = dm.heightPixels / dm.ydpi;
double size = Math.sqrt(Math.pow(screenWidth, 2)
+ Math.pow(screenHeight, 2));
what's the value of size
Original comment by cf27...@gmail.com
on 1 Mar 2012 at 10:31
Of course
returns: 10.20469720465169
Original comment by hamed.za...@gmail.com
on 1 Mar 2012 at 11:22
Thanks, according to this we assume your device is a tablet 10 inch, therefore
we return medium density.
is it a tablet 10inch?
Original comment by cf27...@gmail.com
on 1 Mar 2012 at 11:50
No!
My device is a Motorola Droid (Milestone) A853
Original comment by hamed.za...@gmail.com
on 1 Mar 2012 at 11:55
Ok, so there is a bug in our calculation or the device returns wrong values.
Can you please give the output of the above:
float screenWidth = dm.widthPixels / dm.xdpi;
float screenHeight = dm.heightPixels / dm.ydpi;
What are the values of: dm.widthPixels, dm.xdpi, dm.heightPixels, dm.ydpi,
screenWidth, screenHeight
Thanks
Original comment by cf27...@gmail.com
on 1 Mar 2012 at 12:07
The Log file of values as ordered by you are:
dm.widthPixels, dm.xdpi, dm.heightPixels, dm.ydpi, screenWidth, screenHeight
03-01 15:46:13.952: I/Display Info(4666): 480 96.0 854 96.0 5.0 8.895833
but i should say the lwuit version and thorsten`s port works fine
Original comment by hamed.za...@gmail.com
on 1 Mar 2012 at 12:19
Thanks, seems like it's a motorola device bug:
http://comments.gmane.org/gmane.comp.handhelds.android.devel/110221
The xdpi should be reported 264 and not 96.
I am leaving this bug open, we will need to think of a way to workaround this
device bug.
Thanks for all the help on this issue.
Original comment by cf27...@gmail.com
on 1 Mar 2012 at 12:38
your welcome
i am at your service ;)
Original comment by hamed.za...@gmail.com
on 1 Mar 2012 at 12:43
Original issue reported on code.google.com by
hamed.za...@gmail.com
on 24 Feb 2012 at 4:59