Response from server is like this:
<oob> <type>screen</type> <value>idle</value> <action>show</action> </oob> <oob> <type>schedule</type> <action>show</action> </oob> I want to put all the tags as key and value inside tag as value. Numbers of tags and tag types are not known. I want something like this:
//for first string from server public HashMap<String, String> response = new HashMap<String, String>(); response.put("type","screen"); response.put("value","idle"); response.put("action","show"); //for second string response.put("type","schedule"); response.put("action","show"); There should be the logic to parse the string:
if(server_response.contains("<oob>")){ while(!endof server_response) response.put("?","?"); } How to parse server response in that format?