70 likes | 201 Views
This project outlines the UI implementation for a dynamic search feature in James Cooper's favorite record store. It retrieves search results through an HTTP GET request with dynamic parameters, using text parsing to extract relevant data. Results are asynchronously processed in a separate thread to ensure UI responsiveness, leveraging Android message queues for thread safety. Users can browse items in a ListView control, select one to view detailed information, including album art, with asynchronous loading. The system also accounts for varied data formats from multiple sites.
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