How do I disable the lock-screen when my Samsung Galaxy S II is charging/connected via USB? When I develop for my Samsung Galaxy S II, the screen locks as usual after the configured time. However, for development it would be practical if the phone would just stay awake while it is connected to my computer.

So, 
How do I disable the lock-screen when my Samsung Galaxy S II is charging/connected via USB?

Question: Display On when plugged in is not a duplicate, as this solution does not work on the Galaxy S II. Unfortunately.
Try the app StayAwake, it should work for Galaxy S II too.