Skip to Navigation | Skip to Content



PhoneGap TextMate Bundle | November 22nd, 2010

Dear TextMate users/PhoneGap developers,

I put together a little bundle for your favorite editor. You should now be able to easily get code snippets right in your editor.

You can find it here

Installation instructions are here

How to use:

Type accel.wa and press Tab and you should get:


function onSuccess(acceleration) {
    alert('Acceleration X: ' + acceleration.x + '\n' +
          'Acceleration Y: ' + acceleration.y + '\n' +
          'Acceleration Z: ' + acceleration.z + '\n' +
          'Timestamp: '      + acceleration.timestamp + '\n');
};
function onError() {
    alert('onError!');
};
var options = { frequency: 3000 };  // Update every 3 seconds
var watchID = navigator.accelerometer.watchAcceleration(onSuccess, onError, options);

Now all you have to do is modify the callbacks to suit your needs! Almost every API method should be present.

Feedback always welcome!

Posted in PhoneGap | Comments Off | Add to Delicious | Digg It

This entry was posted on Monday, November 22nd, 2010 at 5:55 pm and is filed under PhoneGap. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.


Search Posts

Archives

Categories