I wrote a Java client for testing.Program, Message sending and receiving are useless, and then moved into Android. This is really a great deal of effort. debug has been on and off for three or four days.
The basicserverconnection routine of Android always has an error. The error is that the methods in the jar package are not self-written. Think hard for a day. You can only write a small program to test the usage of SFS in Android. First, test the connection and navigate to the server end of the graduation project. The result is that the server cannot be connected. After one day of debugging, the android project forgot the network access permission. Great sweat went home from work.
Then it is proved that the SFS client can access the server, but it still fails. Finally, I finally found the problem by visiting Google's site search. In the inconspicuous post of the SFS forum, the moderator posted a frequently asked question. I am angry! Let's not talk about the APIs on Mao official website,CodeLet me talk about it. Post: http://www.smartfoxserver.com/forums/viewtopic.php? T = 10370 & SID = e8738ca6731e59edfda-1634fbef69b4
This is a god post. I have encountered three common problems. 1. Android Network access permission. 2.127.0.0.1 is not the local address of the android simulator, but 10.0.0.2. 3. the android client uses IPv6 by default. To use IPv4, you need to add the following statement:
system. setproperty ("java.net. preferipv6addresses "," false ");