Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVG to Android Shape [closed]

I'm wondering how vector drawing in Android with the Shape class may resemble another vector drawing standard.

Since Shape is a Drawable, and Drawables are usually defined as XML, it sounds a lot like the vector drawing commands in SVG.

My question is this: Has anybody created an XSLT transformation, or other mechanism, for converting an SVG drawing description into Android Shapes?

like image 759
Buggieboy Avatar asked Jun 03 '10 19:06

Buggieboy


People also ask

Can I use SVG in android?

Android Studio includes a tool called Vector Asset Studio that helps you add material icons and import Scalable Vector Graphic (SVG) and Adobe Photoshop Document (PSD) files into your project as vector drawable resources.

What is stroke in shape android?

Sometimes you want an outline around your shape and to do that you can use the stroke tag. You can specify the width and color of the outline using android:width and android:color. Since your shape is a rectangle, you can round rectangle's corners. You can do that inside of the corners tag.

What is the default location of the vector icons imported through Android Studio?

@Apurva its not always true.In new version of android studio if you import a launcher icon via image asset then it will go in res/mipmap instead.


2 Answers

Another non-GPL'd library (this one is Apache License 2.0), the one used in Google's Androidify app: svg-android

https://github.com/pents90/svg-android

like image 179
dgmltn Avatar answered Sep 21 '22 04:09

dgmltn


Well, not exactly. But I do have ported libsvg to android, which enables you to load SVG files and plot them to a Canvas.

Please check out:

https://launchpad.net/libsvg-android

like image 34
Anton P Avatar answered Sep 21 '22 04:09

Anton P