Posts with the tag 'RPositionServer'

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


标签

Calendar

09月 2010
« Apr    
 12345
6789101112
13141516171819
20212223242526
27282930  

Posts by Month

Posts by Category