Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User nicholso's Avatar
    Join Date
    Mar 2003
    Posts
    45
    Hi

    I have a 5800 Xpress and TactileFeedback class works fine.

    I tried the same midlet (built with 5th Edition) in 3rd edition devices E71 and E90 and an unhandled exception occurs. From JaveME 3.0 library documentation the two calls to create the object and check if touch feedback supported should not throw exceptions. What could be the problem?

    Thanks.

    This code reproduces the problem. Build with 5th Edition SDK v0.9, and install midlet on Nokia E71 or E90.
    Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import com.nokia.mid.ui.TactileFeedback; 
    
    /**
     * @author nicholso
     */
    public class TacFeedback extends MIDlet {
        
        private TactileFeedback tactileFeedback = null;
        
        public void startApp() {
            
           // this try catch block does not handle the exception
           try {
                tactileFeedback = new TactileFeedback();
                
                if (tactileFeedback != null ) {
                    if (!tactileFeedback.isTouchFeedbackSupported()) {
                        // set to null - tactile feedback is not supported.
                        tactileFeedback = null;
                    }
                }
            } catch ( Exception e ) {
                // set to null - tactile feedback is not supported.
                tactileFeedback = null;
            }
           
        }
    
        public void pauseApp() {
        }
    
        public void destroyApp(boolean unconditional) {
             notifyDestroyed();
        }
    }

  2. #2
    Nokia Developer Champion jappit's Avatar
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,391
    Hi nicholso,

    you're probably getting a ClassNotFoundException, since TactileFeedback does not exist on 3rd edition devices. What you should do, before trying to use it, is check if it is supported at all, for example by using:

    Code:
    boolean tactileFeedbackExists = false;
    try
    {
    	Class.forName("com.nokia.mid.ui.TactileFeedback");
    
    	tactileFeedbackExists = true;
    }
    catch(ClassNotFoundException e)
    {
    }
    Hope it helps,
    Pit

  3. #3
    Registered User nicholso's Avatar
    Join Date
    Mar 2003
    Posts
    45
    Hi Pit

    It works. Thanks!

    Cheers.

Similar Threads

  1. Series 40 5th Edition SDK Includes JSR-211
    By Nokia Ron in forum Mobile Java Tools & SDKs
    Replies: 11
    Last Post: 2011-11-02, 16:07
  2. S60 5th Edition Emulator Crashes
    By Yagiza in forum Symbian Tools & SDKs
    Replies: 26
    Last Post: 2010-08-07, 21:24
  3. Who to start UI development in Series 60 5th edition??
    By rohanwaugh in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-11-03, 06:14
  4. How to change default camera image in S40 5th edition?
    By asahlot in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2008-11-01, 00:37
  5. Problems with Carbide.ui for 5th edition LT
    By tonymtsai in forum Themes/Carbide.ui
    Replies: 12
    Last Post: 2008-07-16, 08:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved