How to detect a device has internal GPS hardware
Using the following code you can detect that if a phone device has an internal GPS hardware.
You have to #include <lbs.h> and link against lbs.lib.
————————————————————
RPositionServer server;
TPositionModuleInfo modInfo;
User::LeaveIfError(server.Connect());
CleanupClosePushL(server);
TUint numModules;
User::LeaveIfError(server.GetNumModules(numModules));
for (TInt i = 0; i < numModules; i++)
{
User::LeaveIfError(server.GetModuleInfoByIndex(i, modInfo));
if ((modInfo.TechnologyType()
== TPositionModuleInfo::ETechnologyTerminal )
&& (modInfo.DeviceLocation()
== TPositionModuleInfo::EDeviceInternal ))
{
User::InfoPrint(_L(”Internal GPS Detected!”));
}
}
CleanupStack::PopAndDestroy(&server);
—————————————————————————
Popularity: 25% [?]
Add comment 11月 12th, 2008