INQ241B
Mobile Apps

Activity 16

Stock Quotes

In this activity you will create an App that displays the current value of a company’s stock given its ticker symbol.

  1. Create a new app that displays a text box with a button next to it like the following:

    stock1
  2. When the user taps the button, the app should display the current stock price for the ticker symbol in the text box, like the following:

    stock2
    The app should use the web->download function to download the web page:

    https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quotes%20where%20symbol%20in%20(%22SYMBOL%22)&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=

    where SYMBOL is the ticker symbol of a company. The stock price is found after the text “Ask”. Use the index of and substring functions to extract the stock price and dsiplay it.

Submission

Please show your source code and run your scripts for the instructor or lab assistant.