×
Namespaces

Variants
Actions

LocationAPI

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: Diego Soares Lopes (09 Feb 2009)
Last edited: hamishwillee (25 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 25 July 2012, at 23:02.
24 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×