Android token size

I need to add custom markers in mapview. First question: is there a standard / standard overlay / marker that I can use? Secondly: if I have to create png to overlay the marker, which is the best size for the image? Do I have to create different images for each screen size (ldpi, mdpi, hdpi)?

+7
source share
2 answers
  • Extend ItemizedOverlay and use OverlayItem , where you can customize the excerpt through setMarker(drawable) .
  • Depends on your design. I personally used 32x32. You have to give different sizes, try to see how they fit.
  • Yes, it is preferable. You can use the bitmap drawable , which can automatically resolve based on your screen size.
+7
source

Despite the fact that the default value is selected for the userโ€™s position, in fact there is nothing suitable in the default drawings for android for the overlay element. Lots of icon sets with the Google Maps API in mind Deviant Art and Smashing Magazine to give you a boost.

Regarding your question about size, it is always recommended to use several versions of the icons to support different screen sizes and densities - especially if your application will be widespread and target a wide range of API levels.

Alternatively, if you are concerned about the physical screen real estate that your drawings occupy, but you donโ€™t want you to make many changes manually, you can scale all your drawings on the fly when you discover screen density based on a common zoom file .xml: From Android Doco

Personally, I take the path of least resistance and provide three versions of all available boxes. To you, buddy!

+1
source

All Articles