How to use PS3 controller for android, nexus 7
There are three methods for doing this, one is connecting the PS3 controller via this cable to Nexus 7’s micro USB port this method only works with certain games that support controllers, simply plugin and play.
The second method is more difficult and requires you to root your nexus7 first – The tutorial I posted here should help you do that, the second method allows you to play any game with your PS3 controls and wireless through bluetooth. Full instructions are here
The second method you will need the Sixaxis app from google play, this app allows for mapping PS3 controllers – setting profiles to make games work the way you want with your gamepad.
Sixaxis controller setup guide
Summary of what you need
A Game controller, PS3 is recommended but people are using Xbox 360 too. You can pick an Official Sony DualShock 3 Controller (PS3) from the link. There are cheaper controllers that work but if your serious about playing games then go for quality. Download sixaxis app from the play store to sync it up.