The Spatial Miscellany

Avatar

A weblog. A website. A geospatial miscellany…

Mobile Phone tracking with a Nokia N95 & MWS

Another rainy weekend proved a good excuse to sit down and put some theory into practice…

The theory goes…take a GPS enabled mobile phone; some beta software from Nokia; a handful of HTML, Javascript and PHP goodness; and you have all the components for a dynamic tracking web service and mapping website?

Well, the theory works! I’ve put a demonstration together at the following link:

Mobile Phone Tracking with a Nokia N95 Demonstration

Given all the current hype regarding some telecomunications technology; I’m puzzled by the apparent lack of interest in the mobile web server. Sure, there are a few pieces to still fall into place, but if the mobile web server’s graduation from Nokia research labs, results in widespread deployment, it must have a profound impact on the web?

Tomorrow's Web...

8 Comments, Comment or Ping

  1. duxxyuk

    I personally would love to run the nokia mobile web server all the time however the biggest and most overpowering constraint is simply the gprs/3g data cost.

  2. Rob

    I have a £5 a month package from Vodafone UK for 500MB data transfer. The sales rep I spoke to was somewhat vague as to the permitted nature of the internet connection (i.e. upload and download?), and couldn’t elaborate on what they considered ‘fair use’.

    I plan to contact them today to see if they are happy with my use so far, or if ‘the computer’ has already issued a prohibitive levy for my experimentation?!

  3. Hey Rob,

    Great example. My only complaint is that my mobile web browsers (Blackberry and Opera Mini) couldn’t view the Google Map. Any plans to provide a cross-browser example?

    Phil

  4. Rob

    No plans. A couple of options working with Google Maps might be 1) Google Maps for Mobile (GMM), but they haven’t exposed an API, and I doubt they will except via Android; or 2) a static map via the Google Maps Static API, but obviously that wouldn’t really work for dynamic tracking.

    Of course by ‘cross platform’ we are now really talking ‘cross device’, this chap has done some work reverse engineering the GMM API, but I think it’s all Microsoft Smart Phone based.

    I doubt any of the other ‘slippy map’ providers offer this flexibility, but I haven’t looked into it…I might try the MultiMap API?

  5. Christine

    Hello Rob,

    This is exactly what I’m working on for my master thesis. I’m focusing on journalism for mobilephones and the ability to show local news based on the users location.

    What changes need to be made to your code so that I can run this on my mobile (n82)? I would like to show this as an early example of what I’m planning to do. To show people who don’t have a technology background.

    - Christine

  6. Christine

    I guess what I meant was, how does the php file that parses the xml output look like? And what bits of your code does need to be changed in order to view my location? I’m guessing only the path for the MWS?

  7. Rob

    Hi Christine,

    The contents of the php file below, as you suspect you just need to put in your own mobilesite path. Hope that helps,

    Rob

    < ?php
    //must have the header otherwise response is not recognised as XML
    header('Content-Type:text/xml');
    $doc = new DOMDocument();

    $doc->load( ‘https://robdunfey.mymobilesite.net/rest/presence/location’ );

    $locations = $doc->getElementsByTagName( “location” );

    $returndoc = new DOMDocument(‘1.0′);
    // we want a nice output
    $returndoc->formatOutput = true;

    foreach( $locations as $location )
    {
    $latitudes = $location->getElementsByTagName( “latitude” );
    $latitude = $latitudes->item(0)->nodeValue;

    $longitudes = $location->getElementsByTagName( “longitude” );
    $longitude = $longitudes->item(0)->nodeValue;

    $root = $returndoc->createElement(‘location’);
    $root = $returndoc->appendChild($root);

    $marker = $returndoc->createElement(‘marker’);
    $marker = $root->appendChild($marker);

    $marker->setAttribute(“lat”, “$latitude”);
    $marker->setAttribute(“lng”, “$longitude”);

    //$coords = $doc->createTextNode(“$latitude, $longitude”);
    //$coords = $marker->appendChild($coords);

    }

    echo $returndoc->saveXML() . “\n”;

    ?>

  8. Christine

    Hey Rob,

    Thank you very very much. That was what I was looking for. But I still can’t seem to get it work correctly. It still shows Edinburgh even though my XML file gives other coordinates. I’ll look into and hopefully find a solution. My project will use the coordinates to return “news” that are closer than xxx metres from a SQL database , so not a big problem if i can’t get the map to work. I’ll give you a link if you’re interested, when its been developed a bit more.

    - Christine


 


Free GIS Software...

Download ArcGIS Explorer, a free geobrowser from ESRI!

 

Use ArcGIS Explorer to visualise geographic datasets. The latest build provides full access to Virtual Earth imagery and comprehensive support for several data formats including GeoRSS, KML and ArcGIS Layerfiles.

Before you go

Going so soon? Test your geography with the...

 

Do you support the campaign? Should government-funded and approved agencies such as the Ordnance Survey collect data with significant indirect contributions from the UK tax-payer, but then charge users and companies for access to it?

 

Download Flash plugin