I was implementing a feature in the CalorieCount Android App the other day that was previously implemented in the iOS version of that same app. Just needed to show a list of timezones based on what country was selected. Not rocket science at all, but the iOS implementation was storing the data in a plist file, with a <dict> element inside. So rather than take that data and try to translate it to something more 'android specific' ... I decided to just use the file as is. The biggest benefit was that in the future if we ever had to update the file, I could update it in place, and simply copy it over to the other platform.
So I copied the file into my xml folder, and wrote this simple parser that reads the file in, and parses it into a HashMap
The way I look at it, may as well reuse what we've got, and spend less time yak shaving (ie. translating between platforms) ... git 'er done!
Parse an iOS plist on Android
See more in the archives