Languages

Menu
Sites
Language
Pedometer on the watch face :: example or help.

Hi,

I am attempting to create a watch face with a pedometer step count on the front. I know that this is possible as other people do it. I can not fin out how to do it. The code examples (of which I can only see two) don't actually explain how to do it.

can anyone provide some help.

i want to access the step count and render it as text on the screen.

rending to the screen I can do, but I can't seem to find the right way to get into the right app to access the step data.

Responses

7 Replies
Alex Dem

Hi,
I am not expert in Tizen for Wearable (I think you mean it) but In Tizen SDK for Wearable should be Pedometer example and Pedometer sample overview. Also here is article which maybe could be useful:
http://denvycom.com/blog/accessing-sensor-data-on-samsung-gear-2/
Alexey.

Papa SB

Thanks for the reply and yes, I am talking about he wearable element of Tizen.

i did see that example, but I am unable to get it work.

i am looking for some cheap and cheaful examples where I can use the code to help me develop a cheap and cheerful face. Unfortunately I just can't find what I am after regarding the pedometer.

Seoghyun Kang

Hello,

 

The following code is the core code in the Pedometer web sample.

I think it will be helpful to you.

 

var pedometer = null,
    pedometerData = {},

    CONTEXT_TYPE = 'PEDOMETER';
    

/**
 * Initializes the module
 */
function init() {
    pedometer = (tizen && tizen.humanactivitymonitor) || (window.webapis && window.webapis.motion) || null;
}


/**
 * Registers a change listener
 * @public
 */
function start() {
    pedometer.start(
        CONTEXT_TYPE,
        function onSuccess(pedometerInfo) {
            var pData = {
               calorie: pedometerInfo.cumulativeCalorie,
               distance: pedometerInfo.cumulativeDistance,
               runDownStep: pedometerInfo.cumulativeRunDownStepCount,
               runStep: pedometerInfo.cumulativeRunStepCount,
               runUpStep: pedometerInfo.cumulativeRunUpStepCount,
               speed: pedometerInfo.speed,
               stepStatus: pedometerInfo.stepStatus,
               totalStep: pedometerInfo.cumulativeTotalStepCount,
               walkDownStep: pedometerInfo.cumulativeWalkDownStepCount,
               walkStep: pedometerInfo.cumulativeWalkStepCount,
               walkUpStep: pedometerInfo.cumulativeWalkUpStepCount,
               walkingFrequency: pedometerInfo.walkingFrequency
            };
        
            // TODO

        }
    );
}

 

Thanks.

Thye Chean Lim

Isn't this cumulative step count? Is it possible to do step count per day - just as the step counter shown in default watch faces or Gear Watch Designer?

Thanks!

Palitsyna

Hello,

here you can find an example of app:

http://denvycom.com/blog/accessing-sensor-data-on-samsung-gear-2/

and do not forget to add http://tizen.org/privilege/healthinfo privilege to your config.xml - file.

Hakan Albayrak

Hi By Papa SB,

Sorry for reply after 8 months later :)

Could you find any code for this?

I want to put S Health's actual pedometer count to my watchface but no success. (on Gear 2 not Gear S2)

Thanks 

Hakan

How to get step count as S Health has?