tag:blogger.com,1999:blog-6378577132606981251.post3565959923902809762..comments2024-02-28T04:35:28.331-08:00Comments on Chathura Priyankara's Blog: Android TCP/IP client-server socket program (part one)Chathurahttp://www.blogger.com/profile/00003802348098448692noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-6378577132606981251.post-70883548136350136162015-10-15T06:11:33.187-07:002015-10-15T06:11:33.187-07:00There was a connection problem. The two phones cou...There was a connection problem. The two phones could not connect. No messagesAnonymoushttps://www.blogger.com/profile/13847531899069526075noreply@blogger.comtag:blogger.com,1999:blog-6378577132606981251.post-61927521268250552802015-04-16T13:45:59.884-07:002015-04-16T13:45:59.884-07:00I have tried this example of yours. I am afraid th...I have tried this example of yours. I am afraid that there is a problem and it is not working.<br />I am trying on two different phones connected to a same WiFi connection.<br /><br />I made a little change in your change i.e. in function getDeviceIpAddress(), I declared and initialized<br />NetworkInterface networkInterface = null;<br /> InetAddress inetAddress = null;<br />before the for loops. In the parameters of the second for loop, you wrote:<br /> enumerationIpAddr = networkInterface.getInetAddresses() as a condition of this loop. I want to ask you that how could you access "networkInterface" here as it is being declared inside the previous for loop and thus, is out of scope and must give error of not being declared. That is why I took the liberty of taking it at the beginning of the function and use it like this.<br /><br />However, it is not working. Would you like to give some suggestion?TalZalhttps://www.blogger.com/profile/17259636426537467253noreply@blogger.com