Two solutions depend on your using condition
1. This is simple and 100% work in most phone
Using charging cable and turn on "settings">"Applications">"Development">"Stay awake"
this will keep screen from turn off and it will also prevent from lock timeout as well
2. This is a tricky solution...