You Are Here:

Community: Wiki

 

Talk:How to get compass directions in Java ME

From Forum Nokia Wiki

Reviewer Approved   

Its really great to see another example of Location based Application.This articles has given code on how to use Location API to Make application like Real Compass.Using J2ME classes one can draw compass on screen.

Example has also given code to get latitude,longitude,Speed and course of the device user on the way using inbuilt Device GPS Capability.As J2ME Developer i have tested the give code.

Code is really easy to understand and code explanation is also given in beginning.And The Running application snapshot illustrated for the purpose of readers convenience to see before they try.

--Kalki 18:56, 14 September 2009 (UTC)

Review:

This article describes how to use the Location API to retrieve latitude, longitude, course and speed information. For this reason, perhaps a more appropriate title would be “How to get location information in Java ME”. The article provides sample code, showing how to retrieve the above information using the LocationProvider class which is part of the Location API. The example also shows how to display this information using a simple compass interface.

One thing which could be criticized about the code example provided is that it does not make use of the LocationListener interface for updating the user’s current location. Instead, a thread is created which loops continuously to achieve the same thing. When setting the LocationListener for a LocationProvider instance, the programmer is able to specify an update interval. Therefore what the code example in this article does using a separate thread can actually be achieved using the classes and interfaces provided by the Location API.

An important thing to note about the code example provided is the need to call the setCourseandSpeedRequired method of the Criteria object which is passed along with the request for a LocationProvider instance if course and speed information is required. This is a fairly common error for beginners to make.

--Larry101 09:19, 25 September 2009 (UTC)

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fHttpE3aE2fE2f217E2e218E2e225E2e2E3a2082E2findeE78E2ehtmlE253FX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ