Download presentation
Presentation is loading. Please wait.
1
Bruce Scharlau, University of Aberdeen, 2011
Location for Mobiles Mobile Computing Some slides from MobEduNet Bruce Scharlau, University of Aberdeen, 2011
2
Where… is the question answered by location
How do I get there? What’s around me? Where am I? Bruce Scharlau, University of Aberdeen, 2011
3
Location needs context
Car/Walk Bike ??? Where am I going, and how am I travelling there? Bruce Scharlau, University of Aberdeen, 2011
4
LBS can be pulled by the client
Pull based scenarios let the user determine the interaction: get directions, find a shop, etc Bruce Scharlau, University of Aberdeen, 2011
5
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 Bruce Scharlau, University of Aberdeen, 2011
6
Location can be determined a number of ways for mobiles
A- GPS Satellite GPS Enhanced 911 Cell tower ID Local proximity for Bluetooth Bruce Scharlau, University of Aberdeen, 2011
7
Location methods all offer different features
Real-time positioning methods Accuracy depends on the method used Different level of accuracy Warm-up time Bruce Scharlau, University of Aberdeen, 2011
8
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. Bruce Scharlau, University of Aberdeen, 2011
9
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 Bruce Scharlau, University of Aberdeen, 2011
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
A- GPS Satellite GPS Enhanced 911 Cell tower ID Local proximity for Bluetooth Bruce Scharlau, University of Aberdeen, 2011
12
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 Bruce Scharlau, University of Aberdeen, 2011
13
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 Bruce Scharlau, University of Aberdeen, 2011
14
Short-range positioning beacons use Bluetooth
Small areas like single buildings Local area network can provide location Bluetooth for short-range positioning Bruce Scharlau, University of Aberdeen, 2011
15
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 Bruce Scharlau, University of Aberdeen, 2011
16
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? Bruce Scharlau, University of Aberdeen, 2011
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 Bruce Scharlau, University of Aberdeen, 2011
19
Bruce Scharlau, University of Aberdeen, 2011
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 aren’t 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
Bruce Scharlau, University of Aberdeen, 2011
And where is Aberdeen? What’s the latitude and longitude of Aberdeen? Bruce Scharlau, University of Aberdeen, 2011
23
Aberdeen is west of London
°N °W Bruce Scharlau, University of Aberdeen, 2011
24
Use Google API for location
Select Google APIs for new projects using maps and location Otherwise your app won’t 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 as ‘true’ 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 This allows map tiles to be downloaded to your application Bruce Scharlau, University of Aberdeen, 2011
28
Direction API for routes included
Can use direction API within maps API for routes Bruce Scharlau, University of Aberdeen, 2011
29
LocationListener updates map
This is about as simple as it gets for map display Bruce Scharlau, University of Aberdeen, 2011
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
Bruce Scharlau, University of Aberdeen, 2011
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 Bruce Scharlau, University of Aberdeen, 2011
34
The Location API has only a few components
Source: Nokia Location Guide Bruce Scharlau, University of Aberdeen, 2011
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 Bruce Scharlau, University of Aberdeen, 2011
36
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 Bruce Scharlau, University of Aberdeen, 2011
37
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); Bruce Scharlau, University of Aberdeen, 2011
38
Bruce Scharlau, University of Aberdeen, 2011
Don’t 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. Bruce Scharlau, University of Aberdeen, 2011
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(); Bruce Scharlau, University of Aberdeen, 2011
40
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); } public void providerStateChanged(LocationProvider provider, int newState) { log("providerStateChanged()"); Bruce Scharlau, University of Aberdeen, 2011
41
Use ProximityListener to find out when you’re close to a location
These only work on supported devices Bruce Scharlau, University of Aberdeen, 2011
42
The LandmarkStore provides a location database
Easy to create a LandmarkStore LandmarkStore.createLandmarkStore("Auction"); All LandmarkStores available to ALL Java ME apps String[] stores = LandmarkStore.listLandmarkStores(); Bruce Scharlau, University of Aberdeen, 2011
43
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"); Bruce Scharlau, University of Aberdeen, 2011
44
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); Bruce Scharlau, University of Aberdeen, 2011
45
You may also be able to determine the Orientation of the device
Orientation provides an understanding of ‘North’ 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 Bruce Scharlau, University of Aberdeen, 2011
46
Nokia’s TouristRoute example provides a LBS and MVC study
Source: Nokia Location Guide Bruce Scharlau, University of Aberdeen, 2011
47
TouristRoute startup follows criteria requirements
Source: Nokia Location Guide Bruce Scharlau, University of Aberdeen, 2011
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
IBM example that shows how to use external event tool in WTK (registration required) Nokia tutorial also good on using its tools, and on MVC design for larger app Bruce Scharlau, University of Aberdeen, 2011
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.