how to survive a program from factory reset I want to that a program / software like facebook/gmail/ or any game will survive after factory reset with its configuration as before reset means email id password automatically configured after reset. any suggestion please?
Preserving the application itself (APK) can be easily achieved (with root access) by dropping the .apk in /system/app, but the configurations are a bit trickier to keep.

Factory resets generally do a wipe of /data, which also contains all the configs/gamesaves/etc that all apps installed have, so you might have to use a seperate backup app (I recommend Titanium Backup) for that.