How to detect a device has internal GPS hardware
11月 12th, 2008
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: 19% [?]
Entry Filed under: Symbian开发技巧
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed