0

Currently i am working in Android application, Using plist to store some values in Resource folder, then i get the local plist value from Resource in Android, but i cannot get these, How to parse local plist value in Android? please help me

Thanks

Here i mentioned Plist value here

<?xml version="1.0" encoding="UTF-8"?>
<array>
    <dict>
        <key>Code</key>
        <string>11</string>
        <key>Country</key>
        <string>Afghanistan</string>
    </dict>
    <dict>
        <key>Code</key>
        <string>12213</string>
        <key>Country</key>
        <string>Aland Islands</string>
    </dict>
    <dict>
        <key>Code</key>
        <string>24144</string>
        <key>Country</key>
        <string>Albania</string>
    </dict>
    <dict>
        <key>Code</key>
        <string>35223434</string>
        <key>Country</key>
        <string>Algeria</string>
    </dict>
</array>
SampathKumar
  • 2,525
  • 8
  • 47
  • 82

1 Answers1

1

Check this: Android PList Parser

Example usage from the tests-

PListXMLParser parser = new PListXMLParser();
PListXMLHandler handler = new PListXMLHandler();
parser.setHandler(handler);
parser.parse(plistContentAsString);
PList plist = ((PListXMLHandler)parser.getHandler()).getPlist();
// use the plist
plist.getRootElement(); // get root element
Munim
  • 2,626
  • 1
  • 19
  • 28