I guess you want to encode from your application and not in the mobile end ?
Then encode the html. I would suggest the best html encoder is StringEscapeUtils
StringEscapeUtils.escapeHtml(htmlString)
And if you want to do it from the mobile end then use Html.fromHtml (String source)