Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Google Map Pins display with different sizes on different phones

I am trying try implement display of pins on Android Google Maps.

I've successfully implemented it. However I'm abit confused as to why the pins are displayed in different sizes on different phones.

I am currently using the same R.drawable png file, which is stored under /res/drawable folder. Why is this happening? Is there a way to standardize this?

Below is a comparison for example, between a Samsung and HTC phone:

enter image description here

like image 653
lyk Avatar asked Feb 08 '13 06:02

lyk


People also ask

How do I show all pins on Google Maps?

Manage Your Google Maps ModuleClick on the Google Map menu item, and then click on the Settings tab. You will then see the option to Show all locations. Click to enable this option and Save.


1 Answers

  • small screen phones -> 36 x 36 px (ldpi)(120dpi)image size(keep under res/drawable-ldpi folder)
  • normal screen phones-> 48 x 48 px (mdpi)(160dpi)image size(under res/drawable-mdpi)
  • large screen phones/tablets-> 72 x 72 px (hdpi)(240dpi)image size(under res/drawable-hdpi)
  • extra screen tablets-> 96 x 96 px (xhdpi)(320dpi)image size(under res/drawable-xhdpi)

if you have 4 PNG files with above mentioned size in appropriate folders, then it should look fine on all phones/tablets.

like image 190
SKK Avatar answered Nov 14 '22 21:11

SKK