Basically, I want to create a private chatting environment in android, in which i want to chat with my friend over internet. So my main question is that do i need to have static ip to create a messing app server (like xmpp)?
First thing you should keep in your mind that if you want to chat over internet the first thing you must have the address of that computer or mobile,i should say destination,That is know as IP(Internet Protocol). So the answer of your first question is that you must have an IP address in order to chat,That is Source IP and destination IP.
Now Come to Static and Dynamic IP.If you have your personal VPN(Virtual Private Network) you can use your static IP but if do not have VPN then Its necessary to find the source and destination IP.