70 likes | 193 Views
Record Search. James Cooper. Design. Pings my favorite record store’s search box Displays list of results Details page shows more info. UI. Implementation. HTTP get with dynamic parameters to scrape search results Dodgy text-parsing to extract results
E N D
Record Search James Cooper
Design • Pings my favorite record store’s search box • Displays list of results • Details page shows more info
Implementation • HTTP get with dynamic parameters to scrape search results • Dodgy text-parsing to extract results • Hopefully they don’t change their web site… • Results parsed into a data structure • Asynchronously parsed in a separate thread • Android message queues used for thread safety • Individual results displayed as they are parsed
Implementation • Items displayed in a ListView control • Selecting an item in the ListView passes that item into a details page • Album details are displayed • Includes album art • Loaded asynchronously when you navigate to the details page • Again uses message queues for thread safety
Cut list • Buy link • Image link was static URL • Buy was crazy PHP stuff I didn’t feel like reverse engineering • Multiple sites (like Amazon) • Twice the parsing code • Results listed differently • E.g. “Simon and Garfunkel” vs. “Simon & Garfunkel” • Solution: cross-list by UPC/ISBN, but more work