Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Location API of Series 60 2nd Edition FP2

1 replies · 4,541 views · Started 10 January 2006

Hello ,

I am trying to develop a location enabled application using the Location API's of Series 60 2nd Edition FP2 . I use Nokia 6680 (Symbian 7.0s FP2) for testing purposes.
To begin with, I have tried writing a small code snippet that is expected to show the Location of the user.
This code snippet is taken as is from the SDK documentation for Series 60 2nd Edition FP2.
The code is as follows :

void CappShowLocationContainer::ShowLocation()
{


User::LeaveIfError(server.Connect());

CleanupClosePushL(server);

User::LeaveIfError(positioner.Open(server)); // use default positioning module

CleanupClosePushL(positioner);

_LIT(KCntPhone, "+9892348624"😉;

_LIT(KSrvName, "MyService"😉;

CRequestor* contact = CRequestor::NewLC(

CRequestor::ERequestorContact,

CRequestor::EFormatTelephone,

KCntPhone);

stack.Append(contact);

CRequestor* service = CRequestor::NewLC(

CRequestor::ERequestorService,

CRequestor::EFormatApplication,

KSrvName);

stack.Append(service);

User::LeaveIfError(positioner.SetRequestor(stack));

positioner.NotifyPositionUpdate(posInfo, status);

User::WaitForRequest(status);

User::LeaveIfError(status.Int());

posInfo.GetPosition(position);

// Issue a new Location Request

positioner.NotifyPositionUpdate(posInfo, status);

User::WaitForRequest(status);

User::LeaveIfError(status.Int());

// Cleanup

stack.Reset();

CleanupStack::PopAndDestroy(service);

CleanupStack::PopAndDestroy(contact);

CleanupStack::PopAndDestroy(&positioner); // this will call Close() method

CleanupStack::PopAndDestroy(&server); // this will call Close() method

}

Now, when I put this on the phone a strange thing happens. Instead of pulling up the location information , the phone starts searching for bluetooth devices and even on selecting the present device nothing happens.
Could you tell me whats wrong with the code or do I need to add something to make it work ?

Thanks a lot 😊

Don't know much about location APIs, but I perhaps the phone is looking for a Bluetooth GPS module to get the location?