Sony Smart Extras (Smartwatch) Keeping the screen on – controlling the screen state

In the utils package there is a function that can be used to control the screen state.

    /**
     * Set the accessory screens state.
     *
     * @see Control.Intents#SCREEN_STATE_AUTO
     * @see Control.Intents#SCREEN_STATE_DIM
     * @see Control.Intents#SCREEN_STATE_OFF
     * @see Control.Intents#SCREEN_STATE_ON
     *
     * @param state The screen state.
     */
    protected void setScreenState(final int state) {
        if (Dbg.DEBUG) {
            Dbg.d("setScreenState: " + state);
        }
        Intent intent = new Intent(Control.Intents.CONTROL_SET_SCREEN_STATE_INTENT);
        intent.putExtra(Control.Intents.EXTRA_SCREEN_STATE, state);
        sendToHostApp(intent);
    }

So all we need to do in order to control the screen state is to call this with the correct screen state intent. The following example will keep the screen on

 setScreenState(Intents.SCREEN_STATE_ON);

Sony Smart Extras (Smartwatch) When using an .xml file to specify the layout of an accessory, remember the following

  • All sizes should be expressed in px. This to avoid scaling based on the phone density.
  • If an ImageView is used to show an image, we recommend that you specify layout_width and layout_height in px to avoid scaling based on the phone density.

Note: This is since the phone density is based on the phone (or tablet) you have connected the smart extension to, not the smart extension itself.

Sony Smartwatch Accelerometer sensor when is a axis positive (witch side is up)?

For the axis the values are:

  Positive value Negative value
x: The button is up The button is down
y: The Sony label is up The Sony label is down
z: The Screen is down The screen is up

Also a interesting thing to note, no matter how we all try to (when having the accelerometer using the SENSOR_STATUS_ACCURACY_HIGH) we can not get it to go past 78,15m/s^2.