title: LAN calling in android
body: <p>I want to develop an android application for LAN calling.My app resembles apps like whatsapp, viber etc, so I googled for the same. What I got from different answer is:</p>
  
  <ol>
  <li>Whenever we install whatsapp, the whatsapp server register our number and contact list. The app continuously pings the server and update its status on server.</li>
  <li>When we open the app, it gets the data from server, and if a number is found in contact list, it displays the status of the number and other things. </li>
  <li>Whenever we message some one, the message goes to server and stays there until delivered successfully.</li>
  </ol>
  
  <p>For my app the two steps are:</p>
  
  <ol>
  <li>Find all the devices which has my app, their IP and mac address.</li>
  <li>When devices are found,allow calling between them.</li>
  </ol>
  
  <p>For step 1, I have two options:</p>
  
  <ol>
  <li><p>As whatsapp, I can have a server. It registers the info of the mobile phone, whenever the app is installed. The app pings the server and shows its status. </p></li>
  <li><p>I can use my own network device discovery code. This code scans the network and find the devices. 
  This step is costly, whole network is flooded with the packets. And also it is quite difficult to write <code>network device discovery code</code>.</p></li>
  </ol>
  
  <p>For step two, I want to implement client-socket programming and simply connect the microphone of one device to the speaker of another phone. I think it is challenging, but it is possible.</p>
  
  <p>Please help me with <code>network discovery code</code> or the server setup. I am quite familiar with android development, but very novice to networking. 
  Also how calling is done between these devices? </p>
  
  <p>I have searched for the answer and found the following links: <a href="https://stackoverflow.com/questions/14525777/peer-to-peer-sip-call-with-android-sip-stack">Peer-to-peer SIP call with Android SIP Stack?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/12526305/how-to-implement-voip-in-android">how to implement voip in android</a></p>
  
  <p><a href="https://stackoverflow.com/questions/10734519/voip-on-android-libraries-or-sample-code?rq=1">VOIP on Android libraries or sample code</a></p>
  
  <p>I also put a question on quora:</p>
  
  <p><a href="https://www.quora.com/How-can-I-develop-an-app-having-feature-like-whatsapp-calling-in-android" rel="nofollow noreferrer">https://www.quora.com/How-can-I-develop-an-app-having-feature-like-whatsapp-calling-in-android</a></p>
  
  <p>But, still I am stuck at the beginning. Please help me with it.</p>