×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    45

    Orientation getOrientation is not retrieve the compass azimuth with 6210 Navigator

    JavaTM ME Developer's Library 3.0 tells Orientation works with N6210 using FP2 SDK. I try to retrieve the compass azimuth using a Nokia 6210 Navigator handset with J2ME Location Orientation class.

    6210 magnetic compass is working because I calibrated the compass and Nokia Maps shows a green Compass ring and Nokia Maps are auto-rotated. Great feature!

    When I run the J2ME code (below), with or without Nokia Maps using compass at the same time, the call to create the Orientation object creates an Location Exception. JavaTM ME Developer's Library 3.0 tells that exception means "implementation does not support orientation determination". But N6210 should support orientation according to the documentation.

    Is there some error in my code?

    Code:
    /* 
    getting the orientation info - with Nokia 6210 Navigator
     */ 
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.location.Orientation;
    import javax.microedition.location.LocationException;
     
    public class OrientationMidlet extends MIDlet implements CommandListener { 
    
        Command Exit = new Command("Exit",Command.EXIT,0);
        Command Update = new Command("Update", Command.ITEM, 0);
       
        public Form f=new Form("Orientation demo"); 
    
        // constructor tests whether location API is supported
        public OrientationMidlet() {  
            // check location package is installed
            if (System.getProperty("microedition.location.version") == null) {
                /* Location Package is NOT installed - not very elegant solution... */
                destroyApp(true);
                notifyDestroyed();
            } 
        } 
    
        public void startApp() {
            f.addCommand(Exit);
            f.addCommand(Update);
            f.setCommandListener(this);
            Display.getDisplay(this).setCurrent(f);
    
            updateOrientation();
        } 
    
        public void pauseApp() {} 
    
        public void destroyApp(boolean destroy) {} 
    
        public void commandAction(Command c, Displayable s) {
            if (c == Exit) {
                destroyApp(true);
                notifyDestroyed();
            }
    
            if ( c == Update ) {
                updateOrientation();
            }
        }
    
        
        public void updateOrientation() {
            f.removeCommand(Update);
            f.deleteAll();
            f.append("Accessing...\n");
    
            try {
                // Orientation or = new Orientation( (float)30.0, true, (float)0.0, (float)0.0);
                Orientation or = Orientation.getOrientation();
                
                f.deleteAll();
                
                if ( or != null ) {
                    f.append("Orientation:\n");
                    f.append(" "+ or.getCompassAzimuth() +"°\n");
                    if ( or.isOrientationMagnetic() )
                        f.append (" magnetic north\n");
                    else
                        f.append (" true north\n");
                } else
                    f.append (" compass is not calibrated\n");
                
            } catch( LocationException le) {
                f.append("..device does not support orientation determination\n");
            } catch( java.lang.SecurityException se) {
                f.append("..no query permission\n");
            } catch( Exception e) {
                f.append("..exception\n");
            }  
            f.addCommand(Update);
              
        }
        
    }

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    45

    Re: Orientation getOrientation is not retrieve the compass azimuth with 6210 Navigato

    ... additional information

    I have tested different versions compiled with 3rd Edition for FP2 and 5th Edition for FP2 SDKs; I also tried compiling as either a MIDP 2.0 or MIDP 2.1 application though that shouldn't affect (?)

  3. #3
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Orientation getOrientation is not retrieve the compass azimuth with 6210 Navigato

    Hi

    The Java Developer's Library tells this
    Changes between releases
    From S60 3rd Edition FP2 to S60 5th Edition
    Added support for orientation information for azimuth data.
    http://www.forum.nokia.com/document/...8072A80BC.html

    So 3rd Edition FP2 devices do not support orientation.

    (although yes, this page confusingly points to 6210 manual pages, but it does not state that 6210 supports orientation in Java ME
    http://www.forum.nokia.com/document/...91DECB765.html
    )

    Hartti

  4. #4
    Registered User
    Join Date
    Mar 2003
    Posts
    45

    Re: Orientation getOrientation is not retrieve the compass azimuth with 6210 Navigato

    Thanks Hartti - understood.

  5. #5
    Registered User
    Join Date
    Sep 2006
    Posts
    37

    Re: Orientation getOrientation is not retrieve the compass azimuth with 6210 Navigato

    So, the compass function can't be used in j2me? Is there any other way to get azimuth data? Like getting it from C++ lib?

    I just got navigator today, and am playing around with it.

    K,

  6. #6
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: Orientation getOrientation is not retrieve the compass azimuth with 6210 Navigato

    Quote Originally Posted by SYTDeath View Post
    So, the compass function can't be used in j2me? Is there any other way to get azimuth data? Like getting it from C++ lib?

    I just got navigator today, and am playing around with it.

    K,
    Try with the Sensor FrameWork of the 5th edition !
    It is supported with the 6210 Navigator (I've tested it with SensEx application !)

    BR
    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  7. #7
    Registered User
    Join Date
    Mar 2003
    Posts
    9

    Re: Orientation getOrientation is not retrieve the compass azimuth with 6210 Navigato

    Quote Originally Posted by cyke64 View Post
    Try with the Sensor FrameWork of the 5th edition !
    It is supported with the 6210 Navigator (I've tested it with SensEx application !)

    BR
    Cyke64
    Since the Sensor FW API is not public and I don't have the libraries SensrvClient.lib and SensrvUtil.lib I can't use Sensor FW on my Nokia 6210 Navigator.

    Cyke64 are you using the public 3rd Edition FP2 v1.1 SDK? I can't find the needed files to link against this libraries.


    Cheers,
    JorgeC

Similar Threads

  1. 6210 Navigator Certificate Error
    By poweraidan@yahoo.com in forum Mobile Java Networking & Messaging & Security
    Replies: 5
    Last Post: 2008-09-30, 11:52
  2. Retrieving contact in 6210 Navigator
    By deepu28 in forum Mobile Java General
    Replies: 6
    Last Post: 2008-09-01, 11:30
  3. Web access in 6210 Navigator
    By deepu28 in forum Mobile Java General
    Replies: 1
    Last Post: 2008-08-29, 16:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×