If you wanted to do something like put an app on your friend's phone that would send their location every so many minutes, so that you could display their location on your phone, using the internet, you need to have it send the info to a dedicated server that you set up, or have it save a file on Google drive or something like that. Then have your phone check for the appropriate file and read the information on it. It would be very difficult (not feasible) using IP addresses because the phones get different IP's all the time, like when switching from the phone network to wifi and so on.
If I were doing this I would start here;
http://www.b4x.com/android/forum/threads/android-network-tutorial.7001/
and set up a client to log into my Google Drive account and drop a text file. The name of the file could include information that identifies the sending phone and the time. A client on the other phone could log into the same account, recognize the new file, grab it, and get the data from it.
Location;
http://www.b4x.com/android/forum/th...y-friendly-background-location-updates.35988/
The sending app would need to run as a service, I guess.