4 ms·
"Older Android" is a little hand-wavy: SVG support was only introduced in Honeycomb, so the vast, vast majority of Android browsers still don't do it. Especiall
by untog 14y ago
"Older Android" is a little hand-wavy: SVG support was only introduced in Honeycomb, so the vast, vast majority of Android browsers still don't do it. Especially painful when I was trying to make a cross-platform app with PhoneGap- everything looked great on iOS, then not at all on Android.
I ended up having to use an Illustrator -> Canvas tool (made by Microsoft, oddly), but Canvas is a huge pain when all you want to do is draw some simple shapes. Mobile devices are a huge target for this stuff because of the varying pixel densities, but Android is still mostly a no-go for SVG.
- daleharvey 14y ago> "vast vast majority" seems wrong - http://developer.android.com/about/dashboards/index.html http://developer.android.com/about/dashboards/index.html "The following pie chart and table is based on the number of Android devices that have accessed Google Play within a 14-day period ending on the data collection date noted below."
- jacobolus 14y agoIn the chart you link, it’s 90.2%. How vast a majority do you need?
- daleharvey 14y agoheh, I confused Honeycomb and Gingerbread, my bad
- polshaw 14y agoWorth noting the stock browser is not the only option on android-- Although it is still no doubt a strong majority that lack SVG support.
- dbushell 14y agoQuite a bit hand-wavy! Only because SVG support is easily detected with the likes of Modernizr http://modernizr.com/ http://modernizr.com/. Background images with CSS are very simple to provide both SVG and a raster fallback graphic for. Image elements aren't as simple, but I'd suggest defaulting to SVG in both cases and replacing the source if support doesn't exist. That way the issue with eventually disappear alongside legacy browser usage. As you said the benefits of high pixel densities are visually huge. A small and temporary JS hack is a price worth paying in my opinion.
- untog 14y agoBackground images with CSS are very simple to provide both SVG and a raster fallback graphic for. Oh, sure. But I was talking about just using SVG- for mobile devices with different pixel ratios falling back to raster graphics involves making a number of different size alternatives for each graphic. Not fun.