This article explains how to connect a PlayStation 3 controller to an Android device. Instructions apply to devices running Android 7 or later and the original PS3 Sixaxis controller.
Using PlayStation Controllers for the First Time
To use a PlayStation 3 controller with Android Nougat, you'll need an OTG cable that your device supports.
Connect your OTG cable to your phone or tablet.
Connect the appropriate USB charging cable to your PS3 controller.