-1

I have made an android app for digitalizing buisness cards. In my app i have a capture card button from which i click the photo of the card to be scanned. and from there i am calling the abbyy Ocr sdk api. And i am thus successful ly getting the recoginition result as an xml file. (The result Is attached here : https://i.stack.imgur.com/okgl7.jpg )

Nowmy question is how to extract the field from this xml file and save them in contacts. ?

1 Answers1

0

Try reading how to Parse XML Data

The readFeed() method does the actual work of processing the feed. It looks for elements tagged "entry" as a starting point for recursively processing the feed. If a tag isn't an entry tag, it skips it. Once the whole feed has been recursively processed, readFeed() returns a List containing the entries (including nested data members) it extracted from the feed. This List is then returned by the parser.

private List readFeed(XmlPullParser parser) throws XmlPullParserException, IOException {
    List entries = new ArrayList();

    parser.require(XmlPullParser.START_TAG, ns, "feed");
    while (parser.next() != XmlPullParser.END_TAG) {
        if (parser.getEventType() != XmlPullParser.START_TAG) {
            continue;
        }
        String name = parser.getName();
        // Starts by looking for the entry tag
        if (name.equals("entry")) {
            entries.add(readEntry(parser));
        } else {
            skip(parser);
        }
    }
    return entries;
}
Moh
  • 149
  • 2
  • 12