×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Apr 2011
    Posts
    15

    vibrate on canvas in j2me

    How to vibrate the button or image when pointer pressed event on canvas in j2me.please reply soon.

    Thanks & Regards,
    Meena ganesan,
    Eoxys systems India pvt Lts.,

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

    Re: vibrate on canvas in j2me

    Quote Originally Posted by Meena ganesan View Post
    How to vibrate the button or image when pointer pressed event on canvas in j2me.please reply soon.

    Thanks & Regards,
    Meena ganesan,
    Eoxys systems India pvt Lts.,
    Hey welcome to the Forum Nokia Discussion Boards,

    Well just making confirm before give you a solution,
    Do you wanna let the device vibrate when you press some button/command/image?
    or
    You wanna vibrating effect of the button/image/ when you press the same or on the canvas?
    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
    Apr 2011
    Posts
    15

    Re: vibrate on canvas in j2me

    hi raj,

    I want the vibrating effect of the image when pointer press event on canvas.

    Thanks & Regards,
    Meena ganesan.

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

    Re: vibrate on canvas in j2me

    Quote Originally Posted by Meena ganesan View Post
    hi raj,

    I want the vibrating effect of the image when pointer press event on canvas.

    Thanks & Regards,
    Meena ganesan.
    You have to do it by your own on the canvas. You need to have frames for the animations that you wanna display when the pointer was pressed on the same. You detect the pointer event and then start drawing the frames from the image.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  5. #5
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,087

    Re: vibrate on canvas in j2me

    Quote Originally Posted by Meena ganesan View Post
    hi raj,

    I want the vibrating effect of the image when pointer press event on canvas.

    Thanks & Regards,
    Meena ganesan.
    On your canvas - in Pointerpressed method(), check if the pointer is pressed on the image area - use Display.Vibrate(1000)

    Refer to API -
    vibrate

    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.

    Parameters:
    duration - the number of milliseconds the vibrator should be run, or zero if the vibrator should be turned off
    Returns:
    true if the vibrator can be controlled by the application and this display is in the foreground, false otherwise
    Throws:
    IllegalArgumentException - if duration is negative
    Since:
    MIDP 2.0
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  6. #6
    Registered User
    Join Date
    Apr 2011
    Posts
    15

    Re: vibrate on canvas in j2me

    our problem solved.Thanks a lot sir...

Similar Threads

  1. Image hover effect on canvas in j2me
    By Meena ganesan in forum Mobile Java General
    Replies: 4
    Last Post: 2011-04-12, 08:44
  2. Scrollable text on j2me canvas
    By knights123 in forum Mobile Java General
    Replies: 1
    Last Post: 2009-07-30, 18:18
  3. Canvas in J2ME
    By pablovara in forum Mobile Java General
    Replies: 2
    Last Post: 2006-09-26, 12:14
  4. Alternative to display.vibrate() in J2ME?
    By vics69 in forum Mobile Java General
    Replies: 2
    Last Post: 2006-03-05, 09:07

Posting Permissions

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