Presentation is loading. Please wait.

Presentation is loading. Please wait.

Skyhook.

Similar presentations


Presentation on theme: "Skyhook."— Presentation transcript:

1 skyhook

2 Get skyhook SDK from skyhookwireless.com and decompress
Start a new project with a button and onClickListener Import SkyHookWireless.jar In eclipse, right click on src folder Select build path Select configure Select Libraries tab click “add external jar” button Navigate and select the SkyHookWireless.jar file, which is in the SkyHookWireless/lib folder where the SkyHook SDK was decompressed THEN, select Order and Export tab, and select wpsapi.jar Go to your java source, at the top type import com.skyhookwireless.*;

3 (see skyhookwireless quick start information for up to date information)
Set permissions Internet CHANGE_WIFI_STATE ACCESS_WIFI_STATE ACCEESS_CORSE_LOCATION ACCESS_FINE_LOCATION ACCESS_WAKE_LOCK

4 In main activity, in this case SkyHookTest
Add variables WPS wps = null; WPSAuthentication auth = null; In onClickListener (for the button you made), add wps = new WPS(SkyHookTest.this); auth = new WPSAuthentication("bohacek", "udel"); wps.getLocation(auth, WPSStreetAddressLookup.WPS_NO_STREET_ADDRESS_LOOKUP, callback);

5 run WPSLocationCallback callback = new WPSLocationCallback() {
int cnt = 0; public void done() { cnt = 0; Log.d("skyhooktest","done"); // after done() returns, you can make more WPS calls. } public WPSContinuation handleError(WPSReturnCode error) Log.d("skyhooktest","error code="+error); if (cnt++<10) return WPSContinuation.WPS_CONTINUE; //try again else return WPSContinuation.WPS_STOP; public void handleWPSLocation(WPSLocation location) Log.d("skykooktest","lat="+location.getLatitude()+" long="+location.getLongitude()); }; run

6 Instead of wps, use xps to include gps, i.e.,
WPS wps = null; Use XPS xps = null; wps = new WPS(SkyHook2.this); xps = new XPS(SkyHook2.this); wps.getLocation(auth, WPSStreetAddressLookup.WPS_NO_STREET_ADDRESS_LOOKUP, callback); xps.getLocation(auth, WPSStreetAddressLookup.WPS_NO_STREET_ADDRESS_LOOKUP, callback);


Download ppt "Skyhook."

Similar presentations


Ads by Google