Home » Android » javascript – Raphaeljs library and SmartPhones

javascript – Raphaeljs library and SmartPhones

Posted by: admin June 15, 2020 Leave a comment

Questions:

I used the worderfull javascript library called raphaeljs on my website to draw maps, animations and animated functionalities. I have noticed that the script using this library work perfectly with iPhone but not with Android.

Can someone confirm this (just going on the demo page of raphaeljs will tell you if it works of not) and if it doesn’t, does someone has any idea why, and what could be tested.

Thanks

How to&Answers:

The default Android browser did not support SVG until they recently re-introduced it with Android 2.3. One workaround is to use Opera Mobile (free from the Android Market) which will work whatever the Android version.

EDIT: My mistake, it’s Android 3.0 (Honeycomb) that added SVG support in the default browser.

2ND EDIT: Better add a disclaimer that I work for Opera. There may be other non-default browsers that support SVG (but I haven’t tried them).

Answer:

Actually SVG is supported by Android since 2.0 I think (with WebKit, default browser), it’s just not enabled by default : http://jindroid.com/2010/02/15/svg-support-on-android-webkit/

There’s a patch you can apply (quite hard to do though) to enable it but I would advice you to download Opera or Mozilla Firefox for Android (via Market), which also supports svg quite well (I tested FF4 with Raphael JS).

Regards