DroidPad is a compact application that enables you to use your Android phone as a joystick. It is a free and open source joystick emulation application that's comprehensive.
Here are some screenshots to illustrate the features and user interface of this application:
Software solution that can replace classical gaming controller with phone. Screenshot of DroidPad - 531px · 231pxTurns cell phone or Android device into a game controller. Screenshot of DroidPad - 224px · 262pxDroidPad: User interface. Screenshot of DroidPad - 400px · 280px