views:

73

answers:

1

I searched in the web but i couldn find a single article dealing in a straight forward way on how to find the vibrate on/off logs in logcat. If anybody who is aware of the procedure, please enlighten me. Once again i need it specifically to check if my app triggers vibrator or not...

+1  A: 

Vibration data is not logged by default. Fortunately, there is some code in HardwareServices.java that can be enabled to provide exactly what you want. Keep in mind that since this is part of the framework, changing it will require you to rebuild and reflash your device. If you are running on an ADP or the emulator this should be easy. It might be a bit more challenging if you are doing this on another device.

Locate the following code and replace false with true and you should be all set.

        if (false) {
            String s = "";
            int N = pattern.length;
            for (int i=0; i<N; i++) {
                s += " " + pattern[i];
            }
            Log.i(TAG, "vibrating with pattern: " + s);
        }
Tim Kryger
Thanks a lot Tim...how can i find this hardwareservices.java?
Mithraa
It is available from the [Android Open Source Project](http://source.android.com/source/download.html).
Tim Kryger