12-10-2012, 05:11 PM
J2ME and Location-Based Services
J2ME%20and%20Location%20Based%20Services.pdf (Size: 56.55 KB / Downloads: 33)
What Location-Based Services Do
Location-based services answer three questions: Where am I? What's around me? How do I get there? They
determine the location of the user by using one of several technologies for determining position, then use the
location and other information to provide personalized applications and services. As an example, consider a
wireless 911 emergency service that determines the caller's location automatically. Such a service would be
extremely useful, especially to users who are far from home and don't know local landmarks. Traffic advisories,
navigation help including maps and directions, and roadside assistance are natural location-based services. Other
services can combine present location with information about personal preferences to help users find food, lodging,
and entertainment to fit their tastes and pocketbooks.
The Location API for J2ME
The Location API for J2ME specification defines an optional package, javax.microedition.location, that
enables developers to write wireless location-based applications and services for resource-limited devices like
mobile phones, and can be implemented with any common location method. The compact and generic J2ME
location APIs provide mobile applications with information about the device's present physical location and
orientation (compass direction), and support the creation and use of databases of known landmarks, stored in the
device.
JSR 179 requires the Connected Device Configuration (CDC) or version 1.1 of the Connected Limited Device
Configuration (CLDC). CLDC 1.0 isn't adequate because it doesn't support floating-point numbers, which the API
uses to represent coordinates and other measurements. The Location API doesn't depend on any particular profile
-- it can be used with MIDP or the Personal Profile.
The hardware platform determines which location methods are supported. If it doesn't support at least one location
provider, LBS won't be possible. Applications can request providers with particular characteristics, such as a
minimum degree of accuracy. Some location methods may be free; others may entail service fees. The application
should warn the user before any charges are incurred.
Guidelines
Keep the following guidelines in mind when designing location-based services:
• Handle unavailability of services gracefully. The user's location may not always be available,
for any of several reasons;
o The device is cut off from any of the location methods it supports, in a tunnel or on an airplane for
example.
o The user withholds permission to release the information.
o No location provider that the device supports is available.
• Depending on the method used, determining the location may take a long time. The delay may be so
long that the end result isn't useful in, for example, a navigation application. Keep the user informed.
• Location service fees, typical of network-assisted location methods, can add up quickly, so don't
overuse fee-based services.
• Be sensitive to privacy concerns.
o Tell customers about the information being collected on them and how it will be used.
o Offer customers the choice of what location information to disclose, and when appropriate an option
not to participate.
o Allow customers to review their permission profiles so that they know what they are permitting.
o Protect location information so that it cannot be accessed by unauthorized persons.
You should also take full advantage of the MIDP 2.0 security framework, which restricts the application's access to
location data to cases in which the user explicitly confirms permission.
Summary
Through the Location API for J2ME, you can use information about the user's position to build new kinds of
applications and services for mobile devices such as cell phones and PDAs, and to enhance existing services. JSR
179 specifies a generic API for obtaining locations, and thus makes porting LBS applications to a wide range of
devices much easier. The critical issue that LBS developers must address is the privacy of the customer. To ensure
privacy, follow sound programming guidelines and use the security framework in MIDP 2.0. For More Information