2

Is it possible to find the best-matching resource Programmatically at run-time ?

For example I have some device that have screen properties that makes perfect match for layout-normal-mdpi. How can I, at run time, read that that specification ? For example for my screen the result should be normal screen size and for the density mdpi as perfect match.

Lukap
  • 31,523
  • 64
  • 157
  • 244
  • yes programmatically , sorry I click on wrong item of the context menu in the spell checker list and I didn't noticed :(... – Lukap Jul 27 '11 at 06:55
  • @Kurru not jet, but it is still freaking me out, did you find something ? if you do please provide some links here,Thanks – Lukap Nov 12 '11 at 13:31
  • @Lukap If only... I've been told several times you can't do it though... But with Android that can mean that people dont know how YET... – Kurru Nov 12 '11 at 19:03

1 Answers1

0

This should be able to be done automatically by creating qualified resource folders. If you create multiple resource folders for different conditions the device will read your conditions and choose the best version of the resource for it.

Reference: http://developer.android.com/guide/topics/resources/providing-resources.html

Ashterothi
  • 3,282
  • 1
  • 21
  • 35