To parse an SVG file, use the SVGBuilder class. You should first store your SVG files in the res/raw or assets directory of your Android project.
SVGBuilder provides several methods for loading and configuring the SVG:
readFromResource(Resources resources, int resId): Loads an SVG from res/raw.readFromAsset(AssetManager assets, String fileName): Loads an SVG from the assets folder.setWhiteMode(boolean): If true, draws fills in white and does not draw strokes.setColorSwap(int oldColor, int newColor): Swaps a specific color in the SVG.setColorFilter(ColorFilter filter): Applies a color filter to the entire SVG.setStrokeColorFilter(ColorFilter filter): Applies a color filter specifically to the strokes.setFillColorFilter(ColorFilter filter): Applies a color filter specifically to the fills.
After configuring the builder, call .build() to obtain an SVG instance.
// Load and parse a SVG
SVG svg = new SVGBuilder()
.readFromResource(getResources(), R.raw.someSvgResource) // if svg in res/raw
.readFromAsset(getAssets(), "somePicture.svg") // if svg in assets
// .setWhiteMode(true) // draw fills in white, doesn't draw strokes
// .setColorSwap(0xFF008800, 0xFF33AAFF) // swap a single colour
// .setColorFilter(filter) // run through a colour filter
// .set[Stroke|Fill]ColorFilter(filter) // apply a colour filter to only the stroke or fill
.build();