Is it possible to turn vibration on/off on Sony Smartwatch 2 (by application)?
Asked Answered
A

2

8

I want to enable/disable vibration on Sony Smartwatch 2 in my app on some conditions.

Is it possible and if it so how to do that?

EDIT: I mean enable/disable it globally (notifications, incoming calls etc.), as "Vibrate" setting in SW2 menu.

Actinal answered 23/5, 2015 at 16:45 Comment(5)
@ericbn I tried nothing because I entirely don't know how to do that.Actinal
Did you try Google? You'd have found developer.android.com/reference/android/os/Vibrator.html ...Connatural
@Connatural Vibrator is absolutely not that I need. I need to turn vibration on/off globally, like AudioManager.setVibrateSetting but on SW2. This question is about Sony API, rather than Android API.Actinal
Do you mean you want to enable/disable vibration for notifications on some conditions?Kobayashi
@Kobayashi For notifications and other things like incoming call, not vibration called from my application.Actinal
K
1

You might not be able to do this globally.

From the docs, the watch operates on actions from the host.

I don't have a SW2 right now but you can try to trigger the extension when you detect the device is vibrating.

This would be a start:

public class NoVibrator extends ControlExtension{


// stuff....

 @Override
    public void onStart() {
        if(hasVibrator()){
            stopVibrator();
     }
    }

}

But I suspect this only disables vibration in your app.

You might have to find an exploit to change the settings. (something like this)

Kindliness answered 29/5, 2015 at 18:43 Comment(1)
Suddenly stopVibrator() just makes vibrator active for some amount of time. It seems that this method can only interrupt vibration with infinite repeats (and only between iterations of on/off cycle). Anyway, thanks for response.Actinal
K
1

I don't know what your conditions are but to control the vibration use these methods in the ControlExtension class:

Start:

ControlExtension.startVibrator(int onDuration, int offDuration, int repeats);

Stop:

ControlExtension.stopVibrator();

Edit 1: There is no way to configure vibration for notifications.

Kobayashi answered 1/6, 2015 at 17:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.