Presentation is loading. Please wait.

Presentation is loading. Please wait.

Bruce Scharlau, University of Aberdeen, 2011 Location for Mobiles Mobile Computing Some slides from MobEduNet.

Similar presentations


Presentation on theme: "Bruce Scharlau, University of Aberdeen, 2011 Location for Mobiles Mobile Computing Some slides from MobEduNet."— Presentation transcript:

1 Bruce Scharlau, University of Aberdeen, 2011 Location for Mobiles Mobile Computing Some slides from MobEduNet

2 Bruce Scharlau, University of Aberdeen, 2011 Where… is the question answered by location How do I get there? Whats around me? Where am I?

3 Bruce Scharlau, University of Aberdeen, 2011 Location needs context Where am I going, and how am I travelling there? Car/Walk Bike ???

4 Bruce Scharlau, University of Aberdeen, 2011 LBS can be pulled by the client Pull based scenarios let the user determine the interaction: get directions, find a shop, etc

5 Bruce Scharlau, University of Aberdeen, 2011 LBS push and pull the client Push based scenarios let the service prompt the user: proximity based sending of adverts and coupons Special voucher for startbucks

6 Bruce Scharlau, University of Aberdeen, 2011 Location can be determined a number of ways for mobiles Cell tower ID Satellite GPS A- GPS Enhanced 911 Local proximity for Bluetooth

7 Bruce Scharlau, University of Aberdeen, 2011 Location methods all offer different features Real-time positioning methods Accuracy depends on the method used Different level of accuracy Warm-up time

8 Bruce Scharlau, University of Aberdeen, 2011 The output of the location also differs Location types: –Spatial term –Text description Text description is usually expressed as a street address, including city, postal code, etc.

9 Bruce Scharlau, University of Aberdeen, 2011 Spatial terms provide latitude-longitude-altitude Latitude: 0-90 degrees north or south of the equator Longitude: degrees east or west of the prime meridian, which passes through Greenwich, England Altitude: meters above sea level

10 Go the long way round to remember lat/long Latitude = north/south of the equator Longitude = east/west of Greenwich Bruce Scharlau, University of Aberdeen, 2011

11 Location can be determined a number of ways for mobiles Cell tower ID Satellite GPS A- GPS Enhanced 911 Local proximity for Bluetooth

12 Bruce Scharlau, University of Aberdeen, 2011 Network based positioning uses Cell ID Device is communicating with a Base Transceiver Station (BTS) Current cell ID can be used to identify BTS Accuracy depends on the size of the cell: –A GSM cell may be anywhere from 2 to 20 kilometers in diameter –Other techniques used along with cell ID can achieve accuracy within 150 meters

13 Bruce Scharlau, University of Aberdeen, 2011 Satellite based positioning GPS is controlled by the US Department of Defense, and other systems are also coming online Determines the device's position by calculating differences in the times signals from different satellites take to reach the receiver Most accurate method, between 4 and 40 meters Disadvantages: –Extra hardware can be costly –Consumes battery while in use –Requires some warm-up –Canyon effects in cities, where satellite visibility is intermittent

14 Bruce Scharlau, University of Aberdeen, 2011 Short-range positioning beacons use Bluetooth Small areas like single buildings Local area network can provide location Bluetooth for short-range positioning

15 Bruce Scharlau, University of Aberdeen, 2011 Accuracy is dependent upon the application Some applications don't need high accuracy: –Position information from a larger area Others will be useless if the location isn't accurate enough: –Navigation applications

16 Bruce Scharlau, University of Aberdeen, 2011 There are also other issues to consider Where were you at?, asks the boss. Where is the shipment?, asks the delivery man. What is the pattern of behaviour for this customer?, asks the network operator. All can be answered with Location data, but should they be?

17 Nokia and maps the dark horse? Believe still long way to go with maps: generic now, tailored per context in future Crosss-platform HERE Maps with API for developers Combine maps with AR for more information and content Bruce Scharlau, University of Aberdeen, 2011

18 Foursquare is like a loyalty card Analytics and Yield management: some 500,000 registered merchants with dashboard allows merchants to claim their venue, run specials, and access a host of other data about how 15mn customers interact with their business in real-time. Customer loyalty: Foursquare wants to be "a digital version of a stamp card." This is where check-in specials come in: Free drinks for the mayor or for the nth check-in. Search and Discovery: Foursquare added the Explore feature a year ago to let users search neighborhoods and garner recommendations for nearby businesses. Deals: Foursquare has partnered with a number of daily deal sites over the past year to provide real-time location-based deals foursquare-are-trying-to-become-big-businesses Bruce Scharlau, University of Aberdeen, 2011

19 Location apps not easy Facebook places is little-used by business; possibly as not mobile based app Google Latitude not done much and more of a bolt-on to maps Yelp both desktop (search for places to eat/drink/etc) and mobile with reviews etc, but mainly US Bruce Scharlau, University of Aberdeen, 2011

20 Location based services arent corporate enough Security and privacy policies fine for individuals, but not at business level. People want more control over who sees where they are Location is really another form of social media Bruce Scharlau, University of Aberdeen, 2011

21 LBS in iOS uses location + maps Core location provides where someone is Maps handled by Map Kit Framework Geocoding to move from lat/long to place objects (address, building, etc) on map Reverse geocoding also possible Issue with maps at moment… Bruce Scharlau, University of Aberdeen, 2011

22 And where is Aberdeen? Whats the latitude and longitude of Aberdeen? Bruce Scharlau, University of Aberdeen, 2011

23 Aberdeen is west of London Bruce Scharlau, University of Aberdeen, °N °W

24 Use Google API for location Select Google APIs for new projects using maps and location Otherwise your app wont run Bruce Scharlau, University of Aberdeen, 2011

25 Also put permissions in manifest Need to add permissions for INTERNET ACCESS_COURSE_LOCATION ACCESS_FINE_LOCATION Bruce Scharlau, University of Aberdeen, 2011

26 Manifest also needs to specify map library Apps with maps need to specify need astrue for com.google.android.maps library in manifest Bruce Scharlau, University of Aberdeen, 2011

27 Map layouts need API key Need to get Google MAPs API key to use maps in your apps – referenced in layout Bruce Scharlau, University of Aberdeen, This allows map tiles to be downloaded to your application

28 Direction API for routes included Bruce Scharlau, University of Aberdeen, 2011 Can use direction API within maps API for routes

29 LocationListener updates map Bruce Scharlau, University of Aberdeen, 2011 This is about as simple as it gets for map display

30 Use DDMS tool to set location Bruce Scharlau, University of Aberdeen, 2011

31 Geocoder library to look up location Bruce Scharlau, University of Aberdeen, 2011

32 Summary Maps need API key to be displayed Maps needs permissions set in manifest Maps need API enabled Lots of work done over network Bruce Scharlau, University of Aberdeen, 2011

33 Location API for Java ME is JSR 179 JSR 179: javax.microedition.location package Physical location Orientation (compass direction) Support the creation and use of databases of known landmarks, stored in the device

34 Bruce Scharlau, University of Aberdeen, 2011 The Location API has only a few components Source: Nokia Location Guide

35 Bruce Scharlau, University of Aberdeen, 2011 JSR 179 requires CLDC 1.1 Connected Device Configuration (CDC) or Connected Limited Device Configuration 1.1 (CLDC) for floating-point numbers CLDC 1.0 does not support floating-point numbers No requirements for MIDP

36 Bruce Scharlau, University of Aberdeen, 2011 Hardware determines the other requirements, ie BT, GPS, orientataion Hardware platform determines which location methods are supported At least one is needed for using LBS Request providers with particular characteristics, such as a minimum degree of accuracy Some location methods may be free; others may entail service fees

37 Bruce Scharlau, University of Aberdeen, 2011 Using Java ME the Location API starts with a Criteria Need a LocationProvider, but can only call that once you know the criteria for choosing one: cost, accuracy, etc Criteria c = new Criteria(); LocationProvider lp = LocationProvider.getInstance(c);

38 Bruce Scharlau, University of Aberdeen, 2011 Dont need to write any extra code to get coordinates from Bluetooth GPS API checks for best LocationProvider given the Criteria requirements If it finds an on-board device, then it uses that. If not, then it checks the Bluetooth list of devices for a suitable one, and uses this.

39 Bruce Scharlau, University of Aberdeen, 2011 With a LocationProvider you can call getLocation() to find your location No matching LocationProvider returns null, and a LocationException if no LocationProviders are available Location location = lp.getLocation(10); // timeout in seconds QualifiedCoordinates qc = location.getQualifiedCoordinates(); double lat = qc.getLatitude(); double lon = qc.getLongitude();

40 Bruce Scharlau, University of Aberdeen, 2011 Get period updates on your position with LocationListener // method added by LocationListener public void locationUpdated(LocationProvider provider, Location location) { QualifiedCoordinates qc = location.getQualifiedCoordinates(); double lat = qc.getLatitude(); double lon = qc.getLongitude(); String latString = Double.toString(lat); String lonString = Double.toString(lon); log("locationUpdated(): " + latString + " " + lonString); } // method added by LocationListener public void providerStateChanged(LocationProvider provider, int newState) { log("providerStateChanged()"); }

41 Bruce Scharlau, University of Aberdeen, 2011 Use ProximityListener to find out when youre close to a location These only work on supported devices

42 Bruce Scharlau, University of Aberdeen, 2011 The LandmarkStore provides a location database LandmarkStore.createLandmarkStore("Auction"); String[] stores = LandmarkStore.listLandmarkStores(); Easy to create a LandmarkStore All LandmarkStores available to ALL Java ME apps

43 Bruce Scharlau, University of Aberdeen, 2011 Find your LandmarkStore and then add landmark LandmarkStore ls = LandmarkStore.getInstance("Auction"); qc = new QualifiedCoordinates( , , Float.NaN, Float.NaN, Float.NaN); Landmark landmark = new Landmark("Baseball park", "Forest Park", qc, null); ls.addCategory("Sports"); ls.addLandmark(landmark, "Sports");

44 Bruce Scharlau, University of Aberdeen, 2011 Find landmarks meeting set criteria using Enumeration Enumeration ge = ls.getLandmarks(null, , , , ); while (ge.hasMoreElements()) { Landmark found = (Landmark) ge.nextElement(); log(" " + found.getName()); } ls.getLandmarks(double minLatitude, double maxLatitude, double minLongitude, double maxLongitude);

45 Bruce Scharlau, University of Aberdeen, 2011 You may also be able to determine the Orientation of the device Orientation provides an understanding ofNorth either as magnetic, or true North as magnetic north moves over time This can be used in some devices such as the N95 as a type of accelerometer similar to what is used in the Wii controls

46 Bruce Scharlau, University of Aberdeen, 2011 Nokias TouristRoute example provides a LBS and MVC study Source: Nokia Location Guide

47 Bruce Scharlau, University of Aberdeen, 2011 TouristRoute startup follows criteria requirements Source: Nokia Location Guide

48 TouristRoute is blueprint of sorts, but raises questions too Uses many classes – decomposses objects and views Might be better to use fewer, test if need performance, or other issues resolved Bruce Scharlau, University of Aberdeen, 2011

49 Further references for Location API i-dw-wi-mobilesa-i.html IBM example that shows how to use external event tool in WTK (registration required)http://www.ibm.com/developerworks/edu/w i-dw-wi-mobilesa-i.html s/technologies/location_based_services/ja va.html Nokia tutorial also good on using its tools, and on MVC design for larger apphttp://www.forum.nokia.com/main/resource s/technologies/location_based_services/ja va.html


Download ppt "Bruce Scharlau, University of Aberdeen, 2011 Location for Mobiles Mobile Computing Some slides from MobEduNet."

Similar presentations


Ads by Google