Results 1 to 9 of 9
  1.    #1  
    When looking to implement this, I did not find a concise reference, so I thought that I would put it all in one post here.

    Edit: Apparently I did not search hard enough. See below for a Mojo method which would be acceptable to Palm, although the duration paramter doesn't seem to work as expected.


    1. Your application name has to start with "com.palm.app." to have access to the service, and that will prevent it from being accepted into Palm's App Catalog.

    2. You need a routine to call the vibrator hardware.
    Code:
    YourAssistant.prototype.vibrate = function () {
    	this.controller.serviceRequest("palm://com.palm.vibrate", {
    		method: 'vibrate',
    		parameters: { 'period': 0, 'duration': 50 }
    		}
    	);
    };
    3. Wherever you need haptic feedback execute.
    Code:
    this.vibrate();
    There's a bit of lag, but that's the best you can do at the moment.
    Last edited by johncc; 07/15/2010 at 01:11 AM.
  2. #2  
    Checkers by Keens Studios has a haptic feedback when you click on the checkers pieces. It would be nice to ask them for the method on how to do this.

    Or... illegally search through their source code, but that would be naughty.


    If I helped you or you have downloaded one of my files,
    then least you could do is click the "Thanks" button.
  3. kesne's Avatar
    Posts
    471 Posts
    Global Posts
    491 Global Posts
    #3  
    Quote Originally Posted by Abyssul View Post
    Checkers by Keens Studios has a haptic feedback when you click on the checkers pieces. It would be nice to ask them for the method on how to do this.

    Or... illegally search through their source code, but that would be naughty.
    I'm sure if you ask nicely, they'd be willing to share.

    I'll need to find what I did, but I'll let you know.
  4. kesne's Avatar
    Posts
    471 Posts
    Global Posts
    491 Global Posts
    #4  
    Alright, found it! The following code will make the phone vibrate. Checkers uses this for haptic feedback, and our notification system. The downside of this is that you can't control the duration the vibration, but at least you can use it in any application.

    Code:
    Mojo.Controller.getAppController().playSoundNotification("vibrate", "");
  5.    #5  
    Quote Originally Posted by kesne View Post
    Alright, found it! The following code will make the phone vibrate. Checkers uses this for haptic feedback, and our notification system. The downside of this is that you can't control the duration the vibration, but at least you can use it in any application.
    Code:
    Mojo.Controller.getAppController().playSoundNotification("vibrate", "");
    Thanks for that. The doc reference is APIs - Mojo.Controller.AppController - Palm Developer Center

    Mojo.Controller.AppController.playSoundNotification(soundClass, soundFile, duration)

    Immediately play a notification sound. Note that soundClass should be set to "notifications".
    If you need the device to vibrate, set soundClass to "vibrate".

    Parameters:
    {String} soundClass - class of the sound
    {String} soundFile - partial or full path to the sound file
    {String} duration - of sound in ms
    Unfortunately, using a duration parameter like the following line doesn't seem to change the duration.

    Mojo.Controller.getAppController().playSoundNotification("vibrate", "", "50"); or ,50);
    Last edited by johncc; 07/15/2010 at 01:09 AM.
  6. kesne's Avatar
    Posts
    471 Posts
    Global Posts
    491 Global Posts
    #6  
    Yeah, it doesn't, but at least your apps will be allowed in the catalog!
  7.    #7  
    Quote Originally Posted by kesne View Post
    Yeah, it doesn't, but at least your apps will be allowed in the catalog!
    Like others before me looking for short duration vibration, I'll just have to omit it for the time being. (I notice from my google search that Ampache have vibration commented out in their code.)
  8. #8  
    there is a haptic feedback patch in preware. Don't lnow if that is what you are trying to accomplish...
  9. #9  
    @johncc & @kesne

    Thanks for sharing guys.

Posting Permissions