• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[APP][PACE] Step Notify - Fitbit-esque step notifications

Search This thread

Quinny899

Recognized Developer / Recognized Contributor
Jan 26, 2011
8,581
7,798
24
Salford, Greater Manchester, UK
quinny898.co.uk
This is a really simple app that notifies you at 10 to the hour (between 9:50 and 17:50 by default) if you have not completed 250 steps in that hour. The idea is a clone of that from Fitbit devices. It's designed for the Pace 1 (huanghe) but I think it will work on the Pace 2 (stratos), as the code should be the same (see the "code" section)

You can customise the alert with the following options:
- Choose times to show (any :50 in the day is available, default is 9:50 - 17:50)
- Choose days to show (default all enabled)
- Disable vibration (enabled by default)

Screenshots:



Download:
Version 1.0 (Also attached)

Installation:
Code:
adb install -r StepNotify-1.0.apk

Uninstallation:
Code:
adb uninstall com.kieronquinn.app.stepnotify

Code:

The full code for the app can be found at my GitHub

My initial plan for this app was to integrate the Huami layouts and code by disassembling and repairing them, but that was taking a lot of time so I simply threw together my own Wear-esque layouts with RecyclerViews and padding. It's not ideal but it works and is small.

In terms of step counting, turns out the step counter is accessible via Android APIs, nothing special. I found this by disassembling the Health app using JEB:
Code:
final SensorManager mManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
Sensor mStepSensor = mManager.getDefaultSensor(19);
SensorEventListener mListener = new SensorEventListener() {
    public void onAccuracyChanged(Sensor arg1, int arg2) {
    }

    public void onSensorChanged(SensorEvent arg8) {
        mManager.unregisterListener(this);
        float[] v1 = arg8.values;
        if (v1 != null && v1.length >= 1) {
            int v0 = ((int) v1[0]);
            if (v0 < 0) {
                //Count is less than 0 (?)
            } else {
                //v0 is the step count
            }
        }
    }
};
mManager.registerListener(mListener, mStepSensor, 0);
 

Attachments

  • StepNotify-1.0.apk
    1.4 MB · Views: 490
Last edited:

tspnews

Senior Member
Oct 27, 2007
69
16
Tried the install this weekend. It installed OK and the settings seem to adjust OK but it doesn't seem to work. No alerts from the watch.

Default setting with vibration enabled.

-Thanks -Tsp
 

gidano

Senior Member
Aug 26, 2007
182
41
sympda.blog.hu
I think as a system application should be installed, eg. with Android Commander. It works like this. Maybe there is an ADB command as well, unfortunately I do not know.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 11
    This is a really simple app that notifies you at 10 to the hour (between 9:50 and 17:50 by default) if you have not completed 250 steps in that hour. The idea is a clone of that from Fitbit devices. It's designed for the Pace 1 (huanghe) but I think it will work on the Pace 2 (stratos), as the code should be the same (see the "code" section)

    You can customise the alert with the following options:
    - Choose times to show (any :50 in the day is available, default is 9:50 - 17:50)
    - Choose days to show (default all enabled)
    - Disable vibration (enabled by default)

    Screenshots:



    Download:
    Version 1.0 (Also attached)

    Installation:
    Code:
    adb install -r StepNotify-1.0.apk

    Uninstallation:
    Code:
    adb uninstall com.kieronquinn.app.stepnotify

    Code:

    The full code for the app can be found at my GitHub

    My initial plan for this app was to integrate the Huami layouts and code by disassembling and repairing them, but that was taking a lot of time so I simply threw together my own Wear-esque layouts with RecyclerViews and padding. It's not ideal but it works and is small.

    In terms of step counting, turns out the step counter is accessible via Android APIs, nothing special. I found this by disassembling the Health app using JEB:
    Code:
    final SensorManager mManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
    Sensor mStepSensor = mManager.getDefaultSensor(19);
    SensorEventListener mListener = new SensorEventListener() {
        public void onAccuracyChanged(Sensor arg1, int arg2) {
        }
    
        public void onSensorChanged(SensorEvent arg8) {
            mManager.unregisterListener(this);
            float[] v1 = arg8.values;
            if (v1 != null && v1.length >= 1) {
                int v0 = ((int) v1[0]);
                if (v0 < 0) {
                    //Count is less than 0 (?)
                } else {
                    //v0 is the step count
                }
            }
        }
    };
    mManager.registerListener(mListener, mStepSensor, 0);