Integrating SDKInclude the Library Files The library files are found in the lib directory of the SDK. Add all files into the lib path of your project. Include the Header File The header file is found in the include directory of the SDK. Place the wpsapi.h file on the include path of your application. You will include the header file in your code where you will implement the location calls. WPS Location CallWPS_Location Object The WPS_Location object will contain the location information from the request. It contains the following variables.
double latitude - The latitude value in decimal format One-Time Location Request The one-time location request provides a method to make a single request for location. The request will populate a WPS_Location object that includes the clients' latitude and longitude, as well as other positioning information. You must free the location pointer after you are done using it by calling the WPS_free_location(WPS_Location *) function. A one-time location request call from your application would look like this: // This object will contain your username and realm
// which you received when signing up with Skyhook Wireless as a developer
WPS_SimpleAuthentication authentication;
authentication.username = "yourUsername";
authentication.realm = "yourRealm";
WPS_ReturnCode rc;
// populated with the location results
WPS_Location* location;
rc = WPS_location(&authentication,
WPS_NO_STREET_ADDRESS_LOOKUP,
&location);
if (rc == WPS_OK)
{
// Use the location object - your code here
// Free the location object
WPS_free_location(location);
}
For a more detailed code sample, you may view the wpsapitest.cpp sample included in the sample directory of the SDK download. For more detailed documentation, view the web based documentation in the /documentation/html directory of the SDK download. TroubleshootingFor any questions, please visit the developer forum at: |