Click here to Skip to main content
15,880,725 members
Articles / Programming Languages / C#

Retrieve delayed Stock Quotes via Yahoo! Finance on your Pocket PC

Rate me:
Please Sign up or sign in to vote.
4.72/5 (9 votes)
17 Oct 2005CPOL2 min read 104.7K   460   72   8
Retrieving delayed stock quotes on your Pocket PC.

Sample Image

Introduction

Yahoo! Finance offers 15 minutes delayed Stock quotes packed in a neat .csv format. Using this service for my own on the Desktop PC for quite a while, I now decided to write a Pocket PC version. Using the classes of the System.NET namespace this proved to be a quite a simple task.

The Yahoo Finance Service

The URL we need to retrieve the requested data from the Yahoo Finance service consists of a valid ticker symbol (e.g. Microsoft Germany: MSF.DE) and some query parameters:

  • Basic URL: "http://quote.yahoo.com/d/quotes.csv"
  • "?s=MSF.de": the symbol used for the query
  • "f=sl1d1t1c1ohgvj1pp2owern&e": parameters for the requested information.

A great listing of all parameters for the Yahoo Finance service can be found here.

Using the code

The project consists of a main form and four classes:

  • cDetectInternet: Only checks for a valid internet connection by trying to reach yahoo.de.
  • cDownloadYahooData: This class actually does the downloading of the Yahoo stock data and the graphic stuff.
  • cSettings: Writes and reads the Yahoo URL, ticker symbol and graph URL to and from a simple text file.
  • cGradientListview: Creates this cool PPC 2003 style for the listview in the main form.

Problems encountered during development

I started testing the code on a PPC 2003 emulator where it din't run. Reading the data with a BinaryReader object always threw the error "Invalid chunk size". Searching all over the internet I couldn't find a solution. Amazingly the code proved to work without problems with the PPC 2003 SE emulator and a live PPC 2003 device.

Connecting your PPC Emulator to the Internet

You probably want to test the code with your PPC emulator. To do so you need a working internet connection. I've added some information on how to achieve this task with my download (ConnectPPC.txt).

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Austria Austria
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralList of all symbols Pin
Sapan Patibandha22-May-13 22:32
Sapan Patibandha22-May-13 22:32 
GeneralCopy to SIM Issue Pin
Sreekanth Muralidharan13-Jul-08 14:59
Sreekanth Muralidharan13-Jul-08 14:59 
GeneralHave a Problem in Mobile Development. Pin
Member 403696215-Jan-08 16:50
Member 403696215-Jan-08 16:50 
Hi,stefan
i am a chinese code fans.you can call me Tim.i just learn the mobile developing recently.i have a problem.when i develop the Mobile application.i found that the GPRS connection is not stably.so i have an idea .like this,if the mobile equipments is in the VPN domain , i can use connect to the server via VPN.and if the mobile equipments is out of the VPN domain,i can use GPRS connection.
so, How to automaticly convert the connection type between GPRS and wirless in the mobile project.
waiting your reply..Thank you
Best regards!
Tim.Lu
Generalversion 2005 codin.. [modified] Pin
tupidboy6-May-07 21:21
tupidboy6-May-07 21:21 
GeneralError tipps_download.ico Pin
johaten13-Jul-06 5:39
johaten13-Jul-06 5:39 
AnswerRe: Error tipps_download.ico Pin
sk650722-Sep-06 10:35
sk650722-Sep-06 10:35 
Generalsmartphone 2003 SE Pin
Aviram Solomon2-Dec-05 12:03
Aviram Solomon2-Dec-05 12:03 
QuestionRe: smartphone 2003 SE Pin
venugopal.10@indiatimes.com19-Jan-06 21:24
venugopal.10@indiatimes.com19-Jan-06 21:24 
GeneralProblem with the cool PPC 2003 style for the listview Pin
rhelena21-Oct-05 2:35
rhelena21-Oct-05 2:35 
GeneralRe: Problem with the cool PPC 2003 style for the listview Pin
Nostra23-Oct-05 19:58
Nostra23-Oct-05 19:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.