JSR-179 Location API,J2ME applications can now get user geographic location info using it.
Location API can be used in three different ways like using inbuilt GPS,Using Cell ID and using Blue tooth or WiFi. package javax.microedition.location which enables developers to code location-based applications and services API provides mobile 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.Using Location Class Application can get Latitude and Longitude of user's current location.
Basic Classes used in the given code are Criteria which is used to set horizontal and vertical accuracy.Second Class LocationProvider which is used to set approximate distance of current location.
Complete and detailed Description with specific explanation on each of the basic classes is given nicely in this article. Given code example was used as given in article and produces the same output as written.Very useful for beginners to start developing with LBS applications.
--Kalki 09:03, 27 September 2009 (UTC)