Pocket PC Internet Data Graphing

These days being able to access data held on websites, using an app on a handheld device, is almost a necessity for serious geoscience. It can be useful, for instance, for accessing data that a monitoring station, or lab experiment, communicates to a website. It can also be useful for accessing large databases, maybe in the field where GPS data could allow geo-tagged database accessing. Just as importantly, we mustn't forget that such apps can be a very good way of making otherwise obscure data of interest to the plugged-in masses. For instance, NASA have their own exciting applets to make their information available to all, and Nature have their apps to make their journal contents and news open to anyone who wants to view it. So, just how difficult can it be to make a simple NS Basic program, for the Pocket PC, that can talk a website into providing some data for it to graph?

To find the answer we need two things: some PHP code to generate some data (click here for that), and an NS Basic program (click here for the NSB app, or here to see a text version of the GPL licensed source code). The PHP code is very simple and all it really does is generate a single line of output with a random number (2 to 100) of data points, each one also being random (0 to 100). The output is tagged to tell the Pocket PC where to find the data, as our NS Basic program will receive some preliminary header information as part of its internet communications. A sample of the relevant output is:

<START>11,99,27,45,23,96,33,47,22,6,80<END>

The Pocket PC code, which can be seen running in Figure 1, therefore only has to send a request to the PHP script on a website, extract the data between the start and end tags, split the comma separated values and draw a graph. It's assumed you know how to install the runtimes for NS Basic, if you haven't bought their compiler. If you have problems then all the answers you need should be found at the NS Basic website. Don't worry if you don't yet have a website to run the script on, as the Pocket PC program is coded to communicate with the GeoComputing website, but please change that to your own website if you want to use this project regularly. If you run the program while connected to the internet then you should be able to click the 'go get it' button to retrieve some data from the PHP script and have it graphed. As the PHP code generates random numbers, each time you do so you should get a different graph.

Obviously, for a proper project, you won't want just random numbers. However, if you use the principles involved in the Pocket PC program presented here, plus your own website data, you should be able to create a simple internet-enabled applet without too much fuss. And when you do, you may be surprised at how much more attention your geo-measurements get from all kinds of people. Who knows, your data may become so exciting that you end up with the new killer app!

The Pocket PC program.

Figure 1. The Pocket PC program.