The only way to recover data from phone memory if deleted is with taking phone apart and taking flash memory out(this includes melting down pins). And than put this flash on some other circut board.
Just so that you know how hard is it, enough for most people.
For exstremist what the poster before me said, writing and deleting many times. You could do that on rootet phone with some root explorer program. If you didn use custom ROMs you only need to take care of /data partition, if you did flash a bit DATA partition can move maybe(no sure) so you should do same for /system. Flashing ROM writes to some of system partition, the remainder fill it us with some trash files and to again
I heard 20 times is what makes it 100% FBI secure. But 2 times should make it 99.999% secure anyway
Edit: That 20 number is for hard drives with same special machines. I am not sure how it is with flash, maybe one rewrite makes it totaly unrecoverable already. If you only worried for softwere recovery once is enough.