I\'ve got this xml:
Finally i got Solution like this I have used Dom parsing
public class MainActivity extends Activity {
ArrayList mImageLink;
ArrayList phone_no;
int count;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageLink = new ArrayList();
phone_no = new ArrayList();
try {
File file = new File("mnt/sdcard/Backup_Apps/call_logs/calllog_35777569.xml");
InputStream is = new FileInputStream(file.getPath());
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new InputSource(is));
doc.getDocumentElement().normalize();
NodeList nodeList = doc.getElementsByTagName("alllogs");
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
Element fstElmnt = (Element) node;
mImageLink.add(fstElmnt.getAttribute("count"));
count = Integer.parseInt(mImageLink.get(i));
}
NodeList n = doc.getElementsByTagName("log");
for (int j = 0; j < count; j++) {
Node node = n.item(j);
Element fstElmnt = (Element) node;
phone_no.add(fstElmnt.getAttribute("number"));
}
} catch (Exception e) {
System.out.println("XML Pasing Excpetion = " + e);
}
}
}