0

I need to find out about the smartphone's body dimensions (e.g. 110.5 x 57.5 x 12.2 mm (4.35 x 2.26 x 0.48 in)) on which my app is running, but that's not something you can know with the help of OS/SDK.

So, maybe someone know some trick that I can use to know that, i.e. if rely on screen size?

Or is there some database that contains this information and available for download or via API, so I can get device dimensions by its name?

Nikolay Baluk
  • 2,245
  • 1
  • 19
  • 22
  • I don't think there is any prebuilt database available. – M D Apr 30 '15 at 11:56
  • Hey this is just for pixels not the physical size so you would get the same results for a 2560x1440 5.1" Samsung s6 and a 2560x1440 5.7" Samsung note 4 for example he wants the physical size I think – Ilja KO Apr 30 '15 at 12:04
  • 1
    There's no directly way of find it. There might be some external database but it's guarantee to be incomplete due to the variability of devices, also if there were one, and that is your question, it's not a good SO question because it would be asking for 3rd party resources or libraries. And last, what is the possible use case that knowing programmatically the physical size of the device will make a difference in the app behavior? – Budius Apr 30 '15 at 12:50
  • Thanks @Budius, you're right with all this. And that's why I'm asking about some trick that I believed may exists. Regarding use case, unfortunately I'm under something like NDA, so can't describe it here without permission :(. – Nikolay Baluk Apr 30 '15 at 14:36
  • I hate NDAs... I have a few here too. Just an example, imagine this code is running in one of the brand new Android TV. Then it will say that it's a 52 inches by 30 inches device? I guess that adds very little information while coding. – Budius Apr 30 '15 at 14:46
  • That's right. That use case is for smartphones with camera only. – Nikolay Baluk Apr 30 '15 at 15:11

1 Answers1

0

Sure you can do that see here http://developer.android.com/guide/topics/resources/more-resources.html#Dimension

Ilja KO
  • 1,272
  • 12
  • 26