code for android common use. The part of the code is collected from the Internet.