×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    6

    How can i start the vibrating function in the device

    I would like to use the vibrating device for alarm.
    How can I get toworki in Java?

  2. #2
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: How can i start the vibrating function in the device

    Quote Originally Posted by ujp225110 View Post
    I would like to use the vibrating device for alarm.
    How can I get toworki in Java?
    AFAIK, you can use :
    public boolean vibrate(int duration)
    Requests operation of the device's vibrator. The vibrator is intended to be used to attract the user's attention or as a special effect for games. The return value indicates if the vibrator can be controlled by the application.
    This method switches on the vibrator for the requested duration, or switches it off if the requested duration is zero. If this method is called while the vibrator is still activated from a previous call, the request is interpreted as setting a new duration. It is not interpreted as adding additional time to the original request. This method returns immediately; that is, it must not block the caller while the vibrator is running.

    Calls to this method are honored only if the Display is in the foreground. This method MUST perform no action and return false if the Display is in the background.

    The device MAY limit or override the duration. For devices that do not include a controllable vibrator, calls to this method return false.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    6

    Re: How can i start the vibrating function in the device

    Hi,

    I tried following:

    Display display= getDisplay();
    display.setCurrent(form);
    display.vibrate(500);

    I did not succeed in getting the phone vibrating

  4. #4
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: How can i start the vibrating function in the device

    Quote Originally Posted by ujp225110 View Post
    Hi,

    I tried following:

    Display display= getDisplay();
    display.setCurrent(form);
    display.vibrate(500);

    I did not succeed in getting the phone vibrating
    1. Test by giving the time dueration more minimum 1 seconds or more than that, please note that :
    duration - the number of milliseconds the vibrator should be run, or zero if the vibrator should be turned off

    2. Could you check that what the call to the method vibrate is returning?
    Please note that:
    true if the vibrator can be controlled by the application and this display is in the foreground, false otherwise
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. Vibrating the phone
    By amjedab in forum Symbian
    Replies: 4
    Last Post: 2010-03-02, 06:02
  2. vibrating the phone
    By amjedab in forum Symbian
    Replies: 3
    Last Post: 2010-02-24, 10:08
  3. vibrating phone
    By rokroff in forum Symbian
    Replies: 3
    Last Post: 2009-02-24, 12:54
  4. Replies: 2
    Last Post: 2008-06-19, 10:19
  5. Can't start thread function
    By liuhoihing in forum Symbian
    Replies: 0
    Last Post: 2003-05-05, 06:35

Posting Permissions

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