I am trying for a long time to find a solution about the following problem that I am facing. I get a special json format string from my Database through a Http Request as follows:
<?xml version=\"1.0\" encoding=\"utf-8\"?>
<resources>
<string name=\"Test.Company\">Company</string>
<string> name=\"Test.Point\">Point</string>
</resources>
A format as shown above contains only a string daten type.This format must be used as an XML file for an Android application. The Responed data from server is working properly. The main point is to convert this special jsonformat to XML. I am using the following code for convertion to XML as follows:
JSONObject jsonObject = new JSONObject("jsonStr_responded_from_server"); // throws an exception **of type java.lang.String cannot be converted to JSONObject**
String xml = XML.toString(jsonObject);
Did anyone has similar problem???
No comments:
Post a Comment