Java Reference
In-Depth Information
Table 17-3. Location API Permissions
Permission Name
Methods Protected by This Permission
javax.microedition.location.
LocationProvider.getLocation
Location
LocationProvider.setLocationListener
LocationProvider.getLastKnownLocation
javax.microedition.location.
Orientation.getOrientation
Orientation
javax.microedition.location.
LocationProvider.addProximityListener
ProximityListener
javax.microedition.location.
LandmarkStore.getInstance
LandmarkStore.read
LandmarkStore.listLandmarkStores
javax.microedition.location.
LandmarkStore.addLandmark
LandmarkStore.write
LandmarkStore.deleteLandmark
LandmarkStore.removeLandmarkFromCategory
LandmarkStore.updateLandmark
javax.microedition.location.
LandmarkStore.addCategory
LandmarkStore.category
LandmarkStore.deleteCategory
javax.microedition.location.
LandmarkStore.createLandmarkStore
LandmarkStore.management
LandmarkStore.deleteLandmarkStore
For a user to want to use an LBS application, he or she must trust both the
application and the application's vendor. Establishing this trust isn't just about turning
on and off various MIDlet permissions like the ones in Table 17-3. When crafting your
application, you need to think carefully about why location data is relevant and what
risks your users undertake by sharing their location. The value you provide must be
greater than the risk—real or perceived—to the application user. In addition, your
application should treat location data just as it would any other private data, exposing
it only to the degree that is necessary for your application to function. An obvious
example would be a social-networking application; a user may well want to share his or
her location, but may also want to be able to exercise control over the degree to which
it is shared. For example, the user may want to control public display and share in the
information only with a circle of specific friends.
Using the Location API
Adding location information to news and weather applications is an obvious use of the
Location API, and it's exactly what I do in this section with the WeatherWidget example
you've seen throughout the topic. Based on the WeatherWidget using the kXML parser
from Chapter 13, the WeatherWidget MIDlet shown in Listing 17-2 includes the ability to
use your current location as the location for a weather report.
 
Search WWH ::




Custom Search