Is it possible to support SVG or vectorial images?

139 views
Skip to first unread message

Jorge Ramirez

unread,
Jul 24, 2014, 1:15:38 AM7/24/14
to androi...@googlegroups.com
Thanks :)

Dave Smart

unread,
Jul 27, 2014, 4:43:29 AM7/27/14
to androi...@googlegroups.com

Hi Jorge,

It depends on your Android Device.  Any device with version Android version 4 or later should support SVG and also some of the Samsung devices which are older than version 4 may also support it.  But Kitkat has very good support for SVG.

Try this demo to see if it works for you:-


function OnStart()
{
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "linear", "VCenter,FillXY" );

//Create a web control.
web = app.CreateWebView( 1, 1 );
lay.AddChild( web );
//Create horizontal sub-layout for buttons.
layHoriz = app.CreateLayout( "linear", "Horizontal" );
//Add horizontal layout to main layout.
lay.AddChild( layHoriz );
//Add layout to app.
app.AddLayout( lay );
}


In AndroidScript you can use a WebView control  to render your SVG images and also control them using the 'web.Execute' method.  You could also send events back from inside the WebView to your script if required.

Check out the topic called "[Sample App] HTML5 based App" for an example of interacting with WebViews.

Regards
David



Reply all
Reply to author
Forward
0 new messages