1 / 7

QuoteGrabber App

QuoteGrabber App. Design Approach. Wanted simple stock quote finder to check stocks. Find and display a certain stock quote on startup. Use simple “Get” command to both get and post data. Grab source code and place it into one giant string to parse.

ailish
Download Presentation

QuoteGrabber App

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. QuoteGrabber App

  2. Design Approach • Wanted simple stock quote finder to check stocks • Find and display a certain stock quote on startup • Use simple “Get” command to both get and post data • Grab source code and place it into one giant string to parse • Exception handling for invalid stock tickers

  3. Data Retrieval http://research.scottrade.com/public/stocks/snapshot/snapshot.asp?symbol=(Ticker Symbol) utils_.doGet((urlString + ticker), this); String SourceResponse = new String(utils_.responseToString(resp)); Did I get it?!? <link href=\"/public/common/style/stocks.css\” -NO

  4. Data Retrieval Cont’d tickerIndex = SourceResponse .indexOf("<td class=\"info\" valign=\"bottom\">"); tickerIndex += 33; String theQuote = SourceResponse.substring(tickerIndex, tickerIndex + 6); // Clean up the stock quote. if (theQuote.endsWith("<")) finalQuote = theQuote.substring(0, 5); else if (theQuote.endsWith("/")) finalQuote = theQuote.substring(0, 4); else if (theQuote.endsWith("s")) finalQuote = theQuote.substring(0, 3); else finalQuote = theQuote;

  5. Example

  6. Room for Improvement • Have a larger number of quotes provided at startup of app. • Provide predictive text to determine what ticker the user is trying to input • Provide quotes of corporations similar to the provided ticker (AMD & INTC)

More Related