0

this is my first time asking a question here since I can't find a solution anywhere. I am currently working on the backend of an Android application. The server uses Google Charts to generate some graphics info we need. I used this tutorial http://www.battlehorse.net/page/topics/charts/save_google_charts_as_image.html to convert the charts into images. However this method only works when you click on buttons. I actually need to send the images to the Android app, so I introduced this to the html code

saveAsImg(document.getElementById('chart_div'));

after drawing the chart with the Google Chart tool. And I changed the saveAsImg function on my script to this

function saveAsImg(chartContainer) {
    var imgData = getImgData(chartContainer);
    window.location.href= imgData;
  }

Now on the side of my Android app, I make the requests to the server using httpUrlConnection. The problem is that it gets the http code but it won't catch the redirection, so it doesn't show the graphs that I need. Also I don't want to use a webView, I want to send the url with the png in code64 like I currently do so the app can just get the image.

Please let me know if there is more information I can give you. Thanks.

4

0 回答 0