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 99

Sort by: Newest | Oldest | Most popular

  1. By celestial nadal


    My dualshock 3 only works with cable in my xperia sp c5303 android 4.3 but it did not pair and i cant use it wirelessly even i follow the instructions could you please help me?

  2. By Tamás Birkás


    Hi! :)
    Can I somehow connect my DUALSHOCK 3 controller to my Xperia ST23i? I want to make my android game compatible with it. I know ST23i is not compatible but this is my only one android device. Or can I somehow emulate a DS3 compatible device?

  3. By Oliver Salas


    Sir can you helf me…how can i solve my problem regarding the connection on ps3 z xperia ultra..when i connect the controller using otg cable..usb phone disabled alarm occured and cannot rrcognize it…there is be solution for this or no?

  4. By Shameel Shahid


    Hi I have Sony Xperia v version 4.1 how to update it to 4.2

  5. By Ken Tot


    hi joe

    i have xperia Z1 4.4.2 android version
    tried connecting the DS3 SIXAXIS controller
    when i connect it via USB thru OTG the controller says connected and i was able to play or use it as wired connection

    my problem is that when i remove the Usb connection , it wont work wirelessly

    i used the Xperia™ Connectivity and then go to DUALSHOCK™3 wireless controller
    How to connect a controller option

    step 1 to 3 and it will says finished
    and it was working via USB connection but it wont work after i remove the usb

    the lights on the DS3 will flashed for like 3 seconds and stopped

    and i cant connect wirelessly or it doesnt detect the controller after removing the cable

    DS3 controller works wirelessly on PS3
    tried to reset as well the controller still wont connect

    tried all the forums and t/s that’s possible but still wont connect ..

    please help :)

  6. By muhammad hazim


    I have upgrade my Sony tablet z to 4.3..I can pair ps3 controller and it work on my tablet but cant control on game(fifa14)

    • By Joe Padre


      Hi Muhammad,
      The game needs to be optimised for use with the DUALSHOCK3 Wireless Controller. You can find a list of DS3 controller supported games on
      Best regards,
      Joe from Developer World

  7. By Yauci Gonzalez


    is the SIXAXIS controller compatible in my Xperia Z1 device ?

  8. By Angelique Leonidas


    hi joe! i have a xperia z1 and i also successfully connected the dual shock 3.. however only respawnables is the game i can play with the controller.. example, i saw a video on youtube that a man can play flappybird using the ds3 but when i tried, it didnt work..

    is there any settings i have skipped? and are all not games compatible with ds3?? like real steel, spiderman, etc?? pls reply.. thanks a lot! :))))

  9. By Gert Ploeg


    I have a problem with my xperia z
    The first time it working to connect it (verry nice gaming system) but when i want to play on ps3 i connect the same controller to the ps3 and it works again.
    But few days later i want to connect back to my sony xperia z and now it. Not working no red. Dot like first time try to again and start phone again but nothing works
    I realy want your advice
    How can it not working no more (i dont got any updates i only connect it back to sony ps3?
    Im thinking to buy 1 controller more
    Only speciaal for the sony xperia z because it a nice gaming system.
    Maybe thats works

    Greetings sony fan and gaming fan got sony xperia play first but this is amasing that controller sytem.
    Verry nice ;)
    Hope you can help my.

  10. By Johnlee Schwarz


    Hi I have a problem to connect. My dualshock 3 with my Sony experia z1 and my z tab, I use the cable but it does not want to compete the steps I can only tap the exit butten not the next, the remote light doesnt even come on? Plz help me

  11. By Farhaan Arif


    hi i have the z1 compact and it does not connect with the ps3 control what should i do

  12. By Marko Sardelic


    When I connect the controller to my Xperia Z Ultra, I got the message “USB devices disabled error, Connected USB devices disabled” on my Xperia !?

    Does Anybody know what I’m doing wrong ?

    On the other hand I have Xperia SP, and with the same cable and same controller, everything work perfectly.

    • By Joe Padre


      Hi Marco,
      What version of Android are you running on Xperia Z Ultra? On, there is a notation for Xperia Z Ultra (*5 A defect was found with the Bluetooth connection when using certain models of DUALSHOCK(R)3 wireless controller with Android 4.3. For details, please contact Customer Support at Sony Mobile Communications.)
      Best regards,
      Joe from Developer World.

  13. By Daniel Strombeck


    Hi the one thing I still have yet to figure out is what kind of cable is needed and where to get it. Is it a micro use to mini use? I want to make sure if I fine the cord that it’s the right one.

    • By Eugene Stenson


      It’s called a usb on the go or usb OTG. One end is the micro usb the same end as your phone charger and the other end is a female usb so you can connect your regular ps3 controller charger cable to the phone. You can pick the usb OTG cable on ebay for about €10

  14. By Eugene Stenson


    Hi everyone :-) I am trying to connect a 6 axis to my xperia z. when I go to the 6axsis controller in settings and connect up the controller to my phone nothing happens? Is there anything in particular I have to do? Or have I a problem?

    • By Eugene Stenson


      Forgot to mention I’m running android 4.3

  15. By Эмиль Ханкишиев


    Hello, my friends!
    I use Dualshock3 controller on Sony Xperia Z1 (C6903) smartphone (Android 4.3).
    I wish to add support of PS3 controller to AR.FreeFligh (2.4.10) application to control Parrot AR.Drone 2.0 via my PS3 controller. Can you please help me to do that?
    Thanks in advance!

Show more comments

1-19 of 99 comments. Show all comments