How to add Xperia™ device support for the DUALSHOCK™3 wireless controller in your Android™ game [video]

A wide range of Xperia™ devices support the DUALSHOCK 3 wireless controller, bringing a console-like experience to PlayStation® Mobile games. You can also deliver the same functionality to Android™ games.  Read on to learn how to optimise your games for the DUALSHOCK™3 wireless controller for Android games – you’ll also find guidelines and recommendations, along with the key code mappings for the supported devices.

Develop & optimise your game for the DUALSHOCK™3 wireless controller for Android games
The DUALSHOCK 3 wireless controller provides an intuitive game play experience with gaming buttons and controls. Inputs include:

  • Left and right joysticks.
  • Directional buttons.
  • Digital buttons: triangle, circle, cross, square, L1, R1, L2, R2, Start, Select.

By adding support for the DUALSHOCK™3 wireless controller in your Android game, you’re adding a number of benefits for the end user:

  • An input experience that is more familiar to gamers.
  • Freeing up viewing space by removing onscreen controls.
  • Allowing the games to be controlled wirelessly and be displayed and played on larger screens.

If you’ve already designed your game with generic controller support, such as for a virtual game pad, it’ll be easy to add support for the DUALSHOCK™ 3 wireless controller. You just need to:

  1. Design and convert your existing game interactions to map to the DUALSHOCK™3 wireless controller, keeping in mind the tips mentioned below, and using DUALSHOCK™3 wireless controller keycode mapping table as a reference.
  2. Implement your controller design (see keycode mapping table below) and fine-tune the controls to make sure that it “feels right”, to give users the best controller experience possible.
DUALSHOCK™3 wireless controller (top view).
DUALSHOCK™3 wireless controller (top view).

Tips when adding DUALSHOCK™ 3 wireless controller support
When incorporating DUALSHOCK™3 wireless controller support into your development, you need to follow and keep the following tips in mind:

Tips to keep in mind Notes
A game should be fully playable using only touch screen controls. Most devices only have a touch screen as an input controller.
Hardware buttons should be used consistently throughout a game. Users should be allowed to configure the control settings.
In any menu, except for the main menu, the CIRCLE button should take the user back to the previous menu. In the main menu, the CIRCLE button should prompt the user with the option to exit out of the game. In North America and Europe, the CIRCLE button is used as cancel. In Asia, the CIRCLE button is used as confirm.
In any menu, the X button should be used as the confirmation button. In North America and Europe, the X button is used as confirm. In Asia, the X button is used as cancel.
On screen buttons should not appear when the user is using the DUALSHOCK™3 wireless controller. There should be an option in the options menu to turn the on screen controls off or on.

Implementing the DUALSHOCK™3 wireless controller buttons and joysticks
The DUALSHOCK™3 wireless controller support can be implemented using standard Android APIs. You’ll also need to know the key code mappings when you’re adding support for the DUALSHOCK™ 3 wireless controller in your game. Any key press on the device is described by a sequence of key events. Each key event is generally accompanied by the keycode getKeyCode() and getScanCode().

Use the table below for the keycode and scancode mappings for Xperia™ devices.

Key code mappings for all Xperia™ devices that support the DUALSHOCK™3 wireless controller.

Button Keycode Scancode
Circle: ○ button KEYCODE_DPAD_BUTTON_Y 0x12d
Cross: × button KEYCODE_DPAD_BUTTON_X 0x12e
Triangle: △ button KEYCODE_DPAD_BUTTON_B 0x12c
Square: □ button KEYCODE_DPAD_BUTTON_A 0x12f

The following code snippet shows how buttons are detected from a DUALSHOCK™3 wireless controller.

public boolean onKeyDown(int keyCode, KeyEvent event)
// CROSS button pressed
// CIRCLE button pressed
return super.onKeyDown(keyCode, event);

The left and right analog sticks on the DUALSHOCK™3 wireless controller returns keycodes (UP, DOWN, LEFT, RIGHT for each direction) and can be used as joysticks. Each joystick has two axes (one for vertical and one for horizontal) and the range value can be obtained by calling the getMotionRange(int).  Please keep in mind joystick implementation usually takes more effort and iterations to make the control “feel right”.

For more information and references on the Android gamepad APIs, refer to the InputDevice and MotionRange topics on the Android Developer website.  You can also check out this Android and game controller video from the Android Developers for more tips on how to make your game controller compatible on Android.

How to setup the DUALSHOCK™ 3 wireless controller on your device
Currently, a number of Sony devices offer a setting that will allow you to connect a DUALSHOCK™3 wireless controller via Bluetooth™ to play games wirelessly, and the initial setup of the DUALSHOCK™3 wireless controller is quite easy.

The following Sony smartphones and tablets support the DUALSHOCK®3 wireless controller:

*DUALSHOCK®3 wireless controller can be used when the software is updated to Android 4.2.


DUALSHOCK™3 wireless controller setup menu on an Xperia™ tablet.

In the settings menu of the supported devices, there is an option for “DUALSHOCK™3 wireless controller”. In addition to the DUALSHOCK™3 wireless controller and USB cable, the only other extra item you’ll need to setup your DUALSHOCK™3 wireless controller is a USB on the go adapter. Once the DUALSHOCK™3 wireless controller is connected, it can be used to navigate through menus to select, start and play games.


If you have any questions on how to add DUALSHOCK™3 wireless controller support in your game, feel free to leave us a comment below and we’ll get back to you with an answer as soon as we can!

PlayStation is a registered trademark of Sony Computer Entertainment Inc. SIXAXIS is a trademark of Sony Computer Entertainment Inc.

More information

Comments 149

Sort by: Newest | Oldest | Most popular

  1. By Mr. Android L


    Can I connect dualshock 1 on Xperia Z1 compact

  2. By Tomas KT


    Can I Connect the dualshock 4 controller to xperia z1?

  3. By Gaboku Belmont


    I.have a.t2 ultra… play With the OTG plug on it, but i.can’t bluetooth… Any sugestions?

  4. By Javier Ignacio Zúñiga Miranda


    Does the Xperia C3 (I realized it does support DualShock greatly without other third parties apps) support vibration? Everything works great yet I just realized there’s no vibration nor an option to test the functions of the PS3 pad

  5. By justine caparas


    i’m using dualschock3 controller gamepad bluetooth? from cdr-king….. how to use it my phone is xperia sp please help me

  6. By Deep Panchal


    I can connect DS3 controller with Xperia z 4.4.4 using OTG only. But i cannot connect with Bluetooth wirelessly.When I remove cable after connect with usb to otg then controller get sometimes off or blinking 4 led continuesly.

    • By Gaboku Belmont


      I have the same problem in a t2 ultra..

      Someone help!!

  7. By Keennan Organo


    do the ps3 controller only works on xperia ? or do other brands of controller can support ( ex. Cdr-king)?

    • By Keennan Organo


      Xperia SP*

      • By Joe Padre


        Hi Keennan,
        there are alternative gamepad solutions that you can use with Xperia devices, but that you will need to check the compatibility depending on the manufacturer you are interested in.
        Best regards,
        Joe from Developer World

        • By Tomas KT


          Hello, Can I Connect the dualshock 4 controller to xperia z1?

          • By Joe Padre


            Hi Tomas,
            No, sorry, you can’t use DUALSHOCK4 controller with Xperia Z1.
            Best regards,
            Joe from Developer World

  8. By Gerardo Huerta


    Hi there, I have upgrade my xperia tablet Z to 4.4.4 and I can’t seem to sync the dualshock 3 controller, I even have changed the OTG cable several times, is still possible in this version of Android?? THXS

    • By Joe Padre


      Hi Gerardo,
      An Xperia Tablet Z running 4.4.4 should work with the DUALSHOCK3 controller.
      Best regards,
      Joe from Developer World

  9. By Chintha Rohit


    Can we connect dualshock 1 or dualshock 2 for Xperia Z

    • By Joe Padre


      Hi Chintha,
      Only DS3 will work for Xperia Z.
      Best regards,
      Joe from Developer World

  10. By Pramod Zunjar


    tell me with dualshock 3 connectivity for xperia z ultra can we play any games or just gameloft and EA games???

    • By Joe Padre


      Hi Pramod,
      With DUALSHOCK3 connectivity for Xperia Z Ultra, you can only play games that have been offically optimised by the game developer/studio to work with DS3 and Xperia. On the Xperia Exclusive site (, this includes Bard’s Tale, Gunman Clive, Grand Theft Auto, Max Payne, and Fist of Awesome.
      Best regards,
      Joe from Developer World

  11. By Serkan Ozturk


    Hello, could the developers give us access to the right analog ? I mean the digital pad, the left analog et the right analog respond as one, so we have not an dualshock 3 but an playstation 1 controller. So I ask to you to dissociate the D-pad and the analogs if it’s possible, and I know it’s possible. Sorry for my english. BTW I have an Xperia Z2. Thank you.

    • By Joe Padre


      Hi Serkan,
      Thanks for your feedback. We will forward your suggestions to the PlayStation team for further investigation and consideration.
      Best regards,
      Joe from Developer World

  12. By Mateusz Pawlak


    Hello, for first i want sorry for my english, next thing i want to know is that possible to connect 2 ps3 pads? I mean that its normaly work if i connect second pad when first is still active, but both controllers are on first slot( this light on number 1 at controller) and my question is that can we seperate them? to one have light on 1 and second on 2?

  13. By Yusuf Yıkar


    Hi joe,
    My xperia z2 cable Controller Playing, but Wireless Connection is NOT connection is cut off please help me… want Wireless

  14. By Trevor Freeman


    I have a” z ultra” . Where is the menu for setting up buttons? Is it in each game that works or is it in my phone somewhere? Any info would be great. Thank you

  15. By Francesco Mohamed


    Can I use the dual shock 3 with my xperia z1 compact???

Show more comments

1-25 of 149 comments. Show all comments