1 / 6

skyhook

skyhook. 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

wei
Download Presentation

skyhook

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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. WPSLocationCallback callback = new WPSLocationCallback() { intcnt = 0; public void done() { cnt = 0; Log.d("skyhooktest","done"); // after done() returns, you can make more WPS calls. } public WPSContinuationhandleError(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., • Instead of • WPS wps = null; • Use • XPS xps= null; • Instead of • wps = new WPS(SkyHook2.this); • Use • xps = new XPS(SkyHook2.this); • Instead of • wps.getLocation(auth, WPSStreetAddressLookup.WPS_NO_STREET_ADDRESS_LOOKUP, callback); • Use • xps.getLocation(auth, WPSStreetAddressLookup.WPS_NO_STREET_ADDRESS_LOOKUP, callback);

More Related