Image resize when running the app on my device (Android Studio) -


i'm starting android studio , have old device running android froyo (api 8) 240x320px display resolution.

  • i have image 240px width , when use imageview wrap_content display image on device, doesn't use whole width of device.

  • when set imageview width 240px, occupies whole width of device (so know device has 240px width), can see it's blurred out.

apparently image being resized lower resolution before being compiled , loaded run on device.

if can me explaining why happens, appreciate, because couldn't find out, searching here , on google.

.

thanks!

as didn't answer question, thinking overnight, think figured out.

  • my display has 2.8", thought it's density around 143dpi ( sqrt(240^2+320^2)/2.8 ).
  • with density, objects declared in 'dp' take space on screen.
  • so, after comparing 'dp' value actual number of pixels on screen, found out density 120dpi (ldpi), 160dp object doesn't have 1 inch on screen, 3/4 of inch.

maybe done device, not compiler (i don't know), declare in 'px', multiplied 3/4 before loading due it's density.

i hope i'm right , have helped same doubt.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -