×
Namespaces

Variants
Actions
Revision as of 02:02, 26 July 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

LocationAPI

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: Diego Soares Lopes (09 Feb 2009)
Last edited: hamishwillee (26 Jul 2012)

Overview

The LocationAPI was developed to facilitate access to to Location information on Symbian OS devices, without the Symbian/C++ code conventions. It's very useful for Qt and OpenC/C++ programmers to create LBS enabled applications.

Header

 //Location header
#include <LocationIntf.h>
 
class Example: public PositionListener
{
public:
/**
* C++ default constructor
*/

Example();
 
/**
* Example virtual destructor
*/

virtual ~Example();
 
/**
* Callback function for receiving data events
* Inherited from PositionListener interface
*/

void receivePos( PositionData );
 
private: //ATRIBUTES
Position *iPosis;
Location *iPositioner;
};

Source

/CPP FILE
 
//Example header file
#include "Example.h"
 
Example::Example()
{
iPositioner = Location::create();
iPositioner->start( this );
}
 
Example::~Example()
{
if ( iPositioner )
{
iPositioner->stop();
delete iPositioner;
iPositioner = NULL;
}
}
 
void Example::receivePos( PositionData )
{
//do sth with GPS data
}
This page was last modified on 26 July 2012, at 02:02.
47 page views in the last 30 days.