I want to program my raspberry pi by connecting it directly to my laptop via Ethernet cable (ssh Xming), I use a 3G dongle to connect my laptop to internet, when I unplug the dongle there will be no connection and ip address will not be available. So should I set a static ip for my laptop also? What ip address, subnetmask and default gateway should I give my laptop and raspberry pi to achieve this?
Yes. Static IP on ethernet interface both on Pi and Laptop. Use a subet which is different than that of 3G dongle.
Edit: Seems that this is not a specific raspberry pi question, but rather basic networking..