Skip to Navigation | Skip to Content



Archive for November, 2010

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


Search Posts

You are currently browsing the Anis Kadri's Blog weblog archives for November, 2010.

Archives

Categories