Android Project

Hello sir … iam trying to make an Android Project where user need to put some valid diagram code… then may app will convert the code into Wel format Graph Image … Is it possible through Android? Iam new …But I need for Android Platform. Help me

Thank you for project :heart:

My Work

protected void onCreate(Bundle _savedInstanceState) {
private void initialize(Bundle _savedInstanceState) {
	webview1 = findViewById(;
	webview1.setWebViewClient(new WebViewClient() {
		public void onPageStarted(WebView _param1, String _param2, Bitmap _param3) {
			final String _url = _param2;
			super.onPageStarted(_param1, _param2, _param3);
		public void onPageFinished(WebView _param1, String _param2) {
			final String _url = _param2;
			final String dotCode = new String ("digraph G { A -> B; B -> C; C -> A; }");
			_param1.evaluateJavascript("renderDotCode('" + dotCode + "');", null);
			super.onPageFinished(_param1, _param2);

private void initializeLogic() {
	webview1.setWebChromeClient(new WebChromeClient() {
		    public boolean onConsoleMessage(ConsoleMessage consoleMessage) {
			        Log.d("WebView Console", consoleMessage.message());
			        return true;

In Graphviz.html file

    <script type="text/javascript" src="file:///android_asset/viz.js"></script>
    <script type="text/javascript">
        function renderDotCode(dotCode) {
            var svg = Viz(dotCode, { format: "svg" });
            document.getElementById("graph").innerHTML = svg;
    <div id="graph"></div>

And library viz.js

To my knowledge, none of the Graphviz software has been ported to Android. There is a javascript version, if that helps.

That’s true sir… but iam using a WebView method to draw using java script and html language

I am not sure graph-support whether satisfied your demand, it is write by pure java without any dependency, but you have to implement text measure interface MeasureText under Android platform, otherwise text measure not accurate.