How to setup usb wifi on RaspberryPi

Standard
1. Edit /etc/network/interfaces
sudo nano /etc/network/interfaces

2. If use dhcp , follow this code
auto wlan0
iface wlan0 inet dhcp
wpa-ssid [Your SSID]
wpa-psk [Your Password]
3. if use static ipaddress , follow this code
auto wlan0
iface wlan0 inet static
wpa-ssid [Your SSID]
wpa-psk [Your Password]
address 192.168.10.100
netmask 255.255.255.0
network 192.168.10.0
broadcast 192.168.10.255
gateway 192.168.10.1