You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by "Leutwyler, Markus" <ma...@hp.com> on 2012/08/08 14:12:44 UTC
cordova-js webOS compass
Probably a question for Jesse
I'm having a bit of trouble implementing the Compass functionality for cordova.js webOS port
The common plugins for Accelerometer and Compass differ in how the call the native side.
For webOS, the compass implementation is very close to what the playbook implementation uses: window.addEventListener("compass",...)
Can I overwrite/add to the functionality of the common plugin to make this work?
Markus
RE: cordova-js webOS compass
Posted by "Leutwyler, Markus" <ma...@hp.com>.
I got that working by following the win8metro example. This will call the callback *each* time the compass data is updated and not once. Wouldn't that clash with the watchHeading function, which is supposed to receive continuous updates (and actually calls getCurrentHeading repeatedly)
Markus
-----Original Message-----
From: Jesse MacFadyen [mailto:purplecabbage@gmail.com]
Sent: Mittwoch, 8. August 2012 17:45
To: callback-dev@incubator.apache.org
Subject: Re: cordova-js webOS compass
Ah, okay. I will have a look in a bit.
Cheers,
Jesse
On 2012-08-08, at 7:38 AM, "Leutwyler, Markus" <ma...@hp.com> wrote:
> I already do it similar to how the win8metro implementation is using, basically overriding getHeading with my own implementations. The problem is the following:
>
> The way to get compass data on webOS is to add an event listener
> window.addEventListener("compass",...) but that also means that I have
> to start and stop the listener myself if I don't want it to keep running. The common plugin for accelerometer keeps track of listeners and starting and stopping but the common plugin for compass does not .. any ideas?
>
> Markus
>
> -----Original Message-----
> From: gtanner@gmail.com [mailto:gtanner@gmail.com] On Behalf Of Gord
> Tanner
> Sent: Mittwoch, 8. August 2012 16:01
> To: callback-dev@incubator.apache.org
> Subject: Re: cordova-js webOS compass
>
> The same is done on the playbook as we just use the device motion event:
>
> https://github.com/apache/incubator-cordova-js/blob/master/lib/playboo
> k/plugin/playbook/accelerometer.js
>
>
>
> On Wed, Aug 8, 2012 at 9:42 AM, Jesse MacFadyen <pu...@gmail.com>wrote:
>
>> Can you do something like this :?
>>
>>
>> https://github.com/purplecabbage/incubator-cordova-js/tree/master/lib
>> /
>> win8metro
>>
>> The pre-exec Accelerometer code is unchanged, and the results mapped back.
>> All overriding is done inside the 'proxy'.
>>
>> Cheers,
>> Jesse
>>
>> On 2012-08-08, at 5:14 AM, "Leutwyler, Markus"
>> <ma...@hp.com>
>> wrote:
>>
>> Probably a question for Jesse
>>
>> I'm having a bit of trouble implementing the Compass functionality
>> for cordova.js webOS port
>>
>> The common plugins for Accelerometer and Compass differ in how the
>> call the native side.
>> For webOS, the compass implementation is very close to what the
>> playbook implementation uses: window.addEventListener("compass",...)
>> Can I overwrite/add to the functionality of the common plugin to make
>> this work?
>>
>> Markus
>
>
>
> --
> Gord Tanner
> Senior Developer / Code Poet
> tinyHippos Inc.
> @tinyhippos
Re: cordova-js webOS compass
Posted by Jesse MacFadyen <pu...@gmail.com>.
Ah, okay. I will have a look in a bit.
Cheers,
Jesse
On 2012-08-08, at 7:38 AM, "Leutwyler, Markus" <ma...@hp.com> wrote:
> I already do it similar to how the win8metro implementation is using, basically overriding getHeading with my own implementations. The problem is the following:
>
> The way to get compass data on webOS is to add an event listener window.addEventListener("compass",...) but that also means that I have to start and stop
> the listener myself if I don't want it to keep running. The common plugin for accelerometer keeps track of listeners and starting and stopping but the common
> plugin for compass does not .. any ideas?
>
> Markus
>
> -----Original Message-----
> From: gtanner@gmail.com [mailto:gtanner@gmail.com] On Behalf Of Gord Tanner
> Sent: Mittwoch, 8. August 2012 16:01
> To: callback-dev@incubator.apache.org
> Subject: Re: cordova-js webOS compass
>
> The same is done on the playbook as we just use the device motion event:
>
> https://github.com/apache/incubator-cordova-js/blob/master/lib/playbook/plugin/playbook/accelerometer.js
>
>
>
> On Wed, Aug 8, 2012 at 9:42 AM, Jesse MacFadyen <pu...@gmail.com>wrote:
>
>> Can you do something like this :?
>>
>>
>> https://github.com/purplecabbage/incubator-cordova-js/tree/master/lib/
>> win8metro
>>
>> The pre-exec Accelerometer code is unchanged, and the results mapped back.
>> All overriding is done inside the 'proxy'.
>>
>> Cheers,
>> Jesse
>>
>> On 2012-08-08, at 5:14 AM, "Leutwyler, Markus"
>> <ma...@hp.com>
>> wrote:
>>
>> Probably a question for Jesse
>>
>> I'm having a bit of trouble implementing the Compass functionality for
>> cordova.js webOS port
>>
>> The common plugins for Accelerometer and Compass differ in how the
>> call the native side.
>> For webOS, the compass implementation is very close to what the
>> playbook implementation uses: window.addEventListener("compass",...)
>> Can I overwrite/add to the functionality of the common plugin to make
>> this work?
>>
>> Markus
>
>
>
> --
> Gord Tanner
> Senior Developer / Code Poet
> tinyHippos Inc.
> @tinyhippos
RE: cordova-js webOS compass
Posted by "Leutwyler, Markus" <ma...@hp.com>.
I already do it similar to how the win8metro implementation is using, basically overriding getHeading with my own implementations. The problem is the following:
The way to get compass data on webOS is to add an event listener window.addEventListener("compass",...) but that also means that I have to start and stop
the listener myself if I don't want it to keep running. The common plugin for accelerometer keeps track of listeners and starting and stopping but the common
plugin for compass does not .. any ideas?
Markus
-----Original Message-----
From: gtanner@gmail.com [mailto:gtanner@gmail.com] On Behalf Of Gord Tanner
Sent: Mittwoch, 8. August 2012 16:01
To: callback-dev@incubator.apache.org
Subject: Re: cordova-js webOS compass
The same is done on the playbook as we just use the device motion event:
https://github.com/apache/incubator-cordova-js/blob/master/lib/playbook/plugin/playbook/accelerometer.js
On Wed, Aug 8, 2012 at 9:42 AM, Jesse MacFadyen <pu...@gmail.com>wrote:
> Can you do something like this :?
>
>
> https://github.com/purplecabbage/incubator-cordova-js/tree/master/lib/
> win8metro
>
> The pre-exec Accelerometer code is unchanged, and the results mapped back.
> All overriding is done inside the 'proxy'.
>
> Cheers,
> Jesse
>
> On 2012-08-08, at 5:14 AM, "Leutwyler, Markus"
> <ma...@hp.com>
> wrote:
>
> Probably a question for Jesse
>
> I'm having a bit of trouble implementing the Compass functionality for
> cordova.js webOS port
>
> The common plugins for Accelerometer and Compass differ in how the
> call the native side.
> For webOS, the compass implementation is very close to what the
> playbook implementation uses: window.addEventListener("compass",...)
> Can I overwrite/add to the functionality of the common plugin to make
> this work?
>
> Markus
>
--
Gord Tanner
Senior Developer / Code Poet
tinyHippos Inc.
@tinyhippos
Re: cordova-js webOS compass
Posted by Gord Tanner <go...@tinyhippos.com>.
The same is done on the playbook as we just use the device motion event:
https://github.com/apache/incubator-cordova-js/blob/master/lib/playbook/plugin/playbook/accelerometer.js
On Wed, Aug 8, 2012 at 9:42 AM, Jesse MacFadyen <pu...@gmail.com>wrote:
> Can you do something like this :?
>
>
> https://github.com/purplecabbage/incubator-cordova-js/tree/master/lib/win8metro
>
> The pre-exec Accelerometer code is unchanged, and the results mapped back.
> All overriding is done inside the 'proxy'.
>
> Cheers,
> Jesse
>
> On 2012-08-08, at 5:14 AM, "Leutwyler, Markus" <ma...@hp.com>
> wrote:
>
> Probably a question for Jesse
>
> I'm having a bit of trouble implementing the Compass functionality for
> cordova.js webOS port
>
> The common plugins for Accelerometer and Compass differ in how the call the
> native side.
> For webOS, the compass implementation is very close to what the playbook
> implementation uses: window.addEventListener("compass",...)
> Can I overwrite/add to the functionality of the common plugin to make this
> work?
>
> Markus
>
--
Gord Tanner
Senior Developer / Code Poet
tinyHippos Inc.
@tinyhippos
Re: cordova-js webOS compass
Posted by Jesse MacFadyen <pu...@gmail.com>.
Can you do something like this :?
https://github.com/purplecabbage/incubator-cordova-js/tree/master/lib/win8metro
The pre-exec Accelerometer code is unchanged, and the results mapped back.
All overriding is done inside the 'proxy'.
Cheers,
Jesse
On 2012-08-08, at 5:14 AM, "Leutwyler, Markus" <ma...@hp.com>
wrote:
Probably a question for Jesse
I'm having a bit of trouble implementing the Compass functionality for
cordova.js webOS port
The common plugins for Accelerometer and Compass differ in how the call the
native side.
For webOS, the compass implementation is very close to what the playbook
implementation uses: window.addEventListener("compass",...)
Can I overwrite/add to the functionality of the common plugin to make this
work?
Markus