I want to write an android phone and computer software interacts with the java socket classes to transfer files. socket object requires the establishment of a computer 's IP address, I want to dynamically obtain the computer IP ( wifi link established in the case ) rather than their own input , ask how to achieve it ?
Now I WifiInfo class getIpAddress (), but unfortunately get the phone 's IP address.
------ Solution ---------------------------------------- ----
according phone connected to the wifi ip address after , because computers and mobile phones with the LAN , you can scan ( trying to connect ) near the ip address , a response is likely wants.
------ Solution ---------------------------------------- ----
phone is connected with the computer , try to send or request data to the computer , the computer if the data is returned , usually containing its IP address , which attempts to parse the returned data from the IP address can be ~
------ reference ---------------------------------------
will it will not be the gateway IP
------ reference ---------------------------------- -----
is a good idea !
------ reference --------------------------------------- < br> If you are a programmer, you can write a Socket listener look. But the Internet also has a lot of such software , you can download a test about
------ reference ------------------------------------ ---
I want to send data to the computer how do ? If so , I let the computer directly to the mobile phone to send the IP address just fine. Can you detail what ?
------ reference --------------------------------------- < br>
I know there is a ScanResult android wifi class of all search results , but the attribute that is not IP. How to call my own to write a Socket can specifically explain ? I was a student ~
------ reference ------------------------------------ ---
ask how to get wifi with the server's IP address . .
没有评论:
发表评论