avoid exception by timeout of searching devices.
display progress bar during taking/saving picture
Close connection when the back button is pressed.

and removed unneccesary codes.