The best method would be using some JSON library, e.g. Jackson ( http://jackson.codehaus.org ).
But if this is not an option simply escape msget before adding it to your string:
The wrong way to do this is
String msgetEscaped = msget.replaceAll("\"", "\\\"");
Either use (as recommended in the comments)
String msgetEscaped = msget.replace("\"", "\\\"");
or
String msgetEscaped = msget.replaceAll("\"", "\\\\\"");
A sample with all three variants can be found here: http://ideone.com/Nt1XzO