webview - SVG support in Android -
webview - SVG support in Android -
we going develop android application show autocad drawing file in svg format in ecma script using. have tested application in emulator , opened svg file in webview. our problem ecmascript in xml tags not executed in webview in android. know android supporting svg 3.0 only. not back upwards ecmascript in svg?
thanks in advance
final string mimetype = "text/html"; final string encoding = "utf-8"; final string html = "<p><img height=\"600px\" width=\"600px \"src=\"file:///android_asset/drawing3.svg\" /></p>"; webview wv = (webview) findviewbyid(r.id.webview_component); wv.getsettings().setjavascriptenabled(true); wv.loaddatawithbaseurl("fake://not/needed", html, mimetype, encoding, ""); ragards shibu
android (3.0 , later) supports svg ecmascript.
the problem ecmacript in svg isn't executed when svg added in <img> tag. tested in several desktop browsers , when svg in <img> tag, ecmascript wasn't executed in of them.
there 5 ways how add together svg in html:
add image<img> tag embed <embed> tag embed <iframe> tag embed <object> tag embed svg code straight html (using <svg> tag) the ecmascript in svg executed if svg embedded in <embed>, <iframe> or <object> tag. when embeding svg code straight in <svg> tag, might necessary code changes (e.g. moving scripts elsewhere in html), should work.
android webview svg
Comments
Post a Comment