×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    36

    works on WTK but does not works on S60 SDK

    Why this code does not work on S60 3RD EDITION SDK FEATURE PACK 2 v1.1 and works on Sun Java(TM) Wireless Toolkit.

    It does not travel into if or else clause. Do not no why?
    Same code works on WTK.
    Code:
    public void startAuthenticate()
        {
            try
            {
                
                //send user name
                DataOutputStream dout = new DataOutputStream(getOutputStream());
                byte[] uerNameByteArray = getTxtUserName().getString().getBytes();
                dout.writeShort(uerNameByteArray.length);
                getOutputStream().write(uerNameByteArray);
                
                //send authentication code
                String authCodeMD5hash = getMD5Hash(getTxtAuthCode().getString());
                getOutputStream().write(authCodeMD5hash.getBytes());
                getStrAuthStatus().setText("Send password...");
                
    	    //getAuthntication
                DataInputStream din = new DataInputStream(getInPutStream());
                if (din.readShort() == ACCEESS_GRANTED)
                {
                    
                    ImageCanvas canvas = new ImageCanvas(getOutputStream());
                    getDisplay().setCurrent(canvas);
                    ChangeImage changethread = new ChangeImage(getInPutStream(), canvas);
                    canvas.setChangeImageThread(changethread);
                    
                }
                else
                {
                    getStrAuthStatus().setText("Access Denied");
                    getTxtUserName().setString("");
                    getTxtAuthCode().setString("");
    
                }
    
    
            }
            catch (IOException ex)
            {
                getStrAuthStatus().setText("error...");
                ex.printStackTrace();
            }
        }
    When comment whole if and else clause and replace it with
    Code:
    ImageCanvas canvas = new ImageCanvas(getOutputStream());
    getDisplay().setCurrent(canvas);
    It goes to the canvas but does not read any events like keypressed.

    Can any one please suggest some solution?

  2. #2
    Registered User
    Join Date
    Oct 2008
    Posts
    36

    Re: works on WTK but does not works on S60 SDK

    IS this S60 SDK provide any interface to monitor
    System.out.printlns'?

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    36

    Re: works on WTK but does not works on S60 SDK

    Sorry there was a comparing of short and int.
    Code:
    if (din.readShort() == ACCEESS_GRANTED)
    Now it's fixed and works perfect.

    But still having the problem of read any events like keypressed in the canvas.
    I have another thread for repainting the canvas.

Similar Threads

  1. Python for S60 1.9.1 released
    By tvijayan in forum Symbian
    Replies: 30
    Last Post: 2009-02-26, 06:16
  2. SDK for S60 2nd FP2 (Nokia 6630) Java development?
    By SanjayKhuntia in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2008-08-27, 09:43
  3. [moved] Not able to link S60 SDK in VS2003 and VS2005
    By msgurikar in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2008-07-25, 10:13
  4. Almost all tools (S60 MIDP SDK B0.1, Nokia S60 SDK Symbian OS v0.3) Crashes
    By alexandershalamov in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2002-07-03, 13:44

Posting Permissions

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