new Accelerometer(); instances an object from a PhoneGap classe.
So first, make sure you have all needed classes imported.

After that, put alerts at each step of the JS code with this syntax:
navigator.notification.alert("Alert Title", "Second title", "Alert Content");

for example:

>   var axl = new Accelerometer();
>
>   axl.watchAcceleration
>   (
>       function (Accel)
>       {
  navigator.notification.alert("Accel", "is updating", Accel.is_updating);
  navigator.notification.alert("Threshold", "", threshold);
>           if (true === Accel.is_updating)
>           {
>               return;
>           }

this could brings you some visibility on what and where a bugfix is
needed in your code

Remi

On Fri, Nov 20, 2009 at 15:18, Ross Butler <[email protected]> wrote:
> I have tried this but it does not seem to work, does it look like I am doing
> something wrong here?]
>
>        {
>   var axl = new Accelerometer();
>
>   axl.watchAcceleration
>   (
>       function (Accel)
>       {
>           if (true === Accel.is_updating)
>           {
>               return;
>           }
>
>           if (Accel.x >= threshold || Accel.x <= (1.5 - threshold))
>           {
>               // The user has shaken their device. Do something
>                                        navigator.notification.alert("Custom
> alert", "Custom title",
> "Yup!");
>               // End something...
>           }
>       }
>     , function(){}
>     , {frequency : 750}
>   );
> }
>
> thanks,
>
> Ross.
>
>
> On 20 Nov 2009, at 14:13, Remi Grumeau wrote:
>
>> There is a built-in shake function in PhoneGap
>> http://phonegap.pbworks.com/Handling-Shake-Events
>>
>> remi
>>
>> On Thu, Nov 19, 2009 at 21:42, Ross Butler <[email protected]>
>> wrote:
>>>
>>> Sorry, I should have mentioned this is for an app and I am using
>>> PhoneGap, hence "index.html"
>>>
>>> Is there any way?
>>>
>>> Thanks,
>>>
>>> Ross.
>>>
>>>
>>> On 19 Nov 2009, at 16:54, Niels Leenheer wrote:
>>>
>>>> Sorry, but this is not possible. Safari doesn't send shake events.
>>>>
>>>> Cheers,
>>>> Niels
>>>>
>>>> Sent from my iPhone
>>>>
>>>> On 19 nov 2009, at 17:47, London iPhone Dev <[email protected]>
>>>> wrote:
>>>>
>>>>> Hey Guys & Gals!
>>>>>
>>>>> Could anyone advise me javascript that will allow me to shake to
>>>>> change page from "index.html" to "menu.html"
>>>>>
>>>>> I'm not a Javascript kinda guy, Your help is much appreciated.
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Ross
>>>>>
>>>>> --
>>>>>
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "iPhoneWebDev" group.
>>>>> To post to this group, send email to [email protected].
>>>>> To unsubscribe from this group, send email to
>>>>> [email protected]
>>>>> .
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/iphonewebdev?hl=
>>>>> .
>>>>>
>>>>>
>>>>
>>>> --
>>>>
>>>> You received this message because you are subscribed to the Google
>>>> Groups "iPhoneWebDev" group.
>>>> To post to this group, send email to [email protected].
>>>> To unsubscribe from this group, send email to
>>>> [email protected]
>>>> .
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/iphonewebdev?hl=
>>>> .
>>>>
>>>>
>>>
>>> --
>>>
>>> You received this message because you are subscribed to the Google Groups
>>> "iPhoneWebDev" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected].
>>> For more options, visit this group at
>>> http://groups.google.com/group/iphonewebdev?hl=.
>>>
>>>
>>>
>>
>> --
>>
>> You received this message because you are subscribed to the Google Groups
>> "iPhoneWebDev" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/iphonewebdev?hl=.
>>
>>
>
>

--

You received this message because you are subscribed to the Google Groups 
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/iphonewebdev?hl=.


Reply via email to