Funny thing is that I ended up using google charts before I saw this. But you actually gave me the perfect solution. I was actually using a Webview, which of course doesn't center the qr code right. If I could use ImageView, then I can fit the image to the view. And your code did it.
Thanks.