Can't Login to Zone with Java
Can't Login to Zone with Java
I have attempted to create a Java client that connects to SFS server. I used the tutorial to connect to the server and that works fine however connecting to a zone doesn't seem to work. In my onConnection handler, I call the login method to the zone. After this it seems to hang. Any ideas? Thanks a lot.
Code: Select all
01-05 14:13:02.534: VERBOSE/SMARTFOXAPP(197): onConnection listener set up.
01-05 14:13:02.534: VERBOSE/SMARTFOXAPP(197): onJoinRoom listener set up.
01-05 14:13:02.534: VERBOSE/SMARTFOXAPP(197): onRoomListUpdate listener set up.
01-05 14:13:02.713: VERBOSE/SMARTFOXAPP(197): [Sending]:<msg t ='sys'><body action='verChk' r='0'><ver v='154' /></body></msg>
01-05 14:13:02.752: VERBOSE/SMARTFOX(197): [RECEIVED]: <cross-domain-policy><allow-access-from domain='*' to-ports='9339' /></cross-domain-policy>, (len: 91)
01-05 14:13:02.893: INFO/ActivityManager(49): Displayed activity com.ibm.SmartFoxApp/.SmartFoxApp: 1179 ms
01-05 14:13:02.944: INFO/global(197): Jan 5, 2009 2:13:02 PM java.io.BufferedReader <init>
01-05 14:13:02.944: INFO/global(197): INFO: Default buffer size used in BufferedReader constructor. It would be better to be explicit if a 8k-char buffer is required.
01-05 14:13:03.002: VERBOSE/SMARTFOX(197): [RECEIVED]: , (len: 0)
I'm trying to connect to a SmartFoxPro Server.
I am using the Java Beta API and I'm using this under Android. The Debug you see is the SmartFoxServer debug statements just using the Android logger. I'm using the sample code from the Java Beta API rar that is provided. As I was debugging it seems like XMLSocket isn't connecting properly. This is just through debugging it step by step. Thanks for you help.
I am sorry, unfortunately the Java API are not currently tested under Android.
As far as I know Google's platform supports a large selection of the Java2SE framework but I am not sure of the limitations.
The XMLSocket library used in the API contain the core socket classes which use java.nio behind the scenes. I guess there could be compatibility problems between at that level.
We'll take a look when we have time and see if we can provide a wrapper or an alternative socket library that works correctly under Android.
Thanks for reporting
As far as I know Google's platform supports a large selection of the Java2SE framework but I am not sure of the limitations.
The XMLSocket library used in the API contain the core socket classes which use java.nio behind the scenes. I guess there could be compatibility problems between at that level.
We'll take a look when we have time and see if we can provide a wrapper or an alternative socket library that works correctly under Android.
Thanks for reporting
The problem is unlikely to be there, as the XMLSocket library is based on xsocket which is the socket library being used.
http://xsocket.sourceforge.net/
I've given another look that log you have posted I am still clueless about what the problem is, exactly.
You seem to be able to establish a connection and receive a couple of messages from the server correctly.
This means that most of the core stuff is actually working pretty well, otherwise you wouldn't be able to even start a connection.
Can you say where the BufferedReader warning is coming from? Is it your code instantiating that object?
As far as I can remember the SFS API code shouldn't use any of those unless it's coming from the socket library.
Also, after you receive an empty message you don't seem to be sending any other requests... what is exactly going on after that?
Is there more to that log data?
http://xsocket.sourceforge.net/
I've given another look that log you have posted I am still clueless about what the problem is, exactly.
You seem to be able to establish a connection and receive a couple of messages from the server correctly.
This means that most of the core stuff is actually working pretty well, otherwise you wouldn't be able to even start a connection.
Can you say where the BufferedReader warning is coming from? Is it your code instantiating that object?
As far as I can remember the SFS API code shouldn't use any of those unless it's coming from the socket library.
Also, after you receive an empty message you don't seem to be sending any other requests... what is exactly going on after that?
Is there more to that log data?
I have an update on this.
We have an alternative version of XMLSocket library which uses Apache Mina instead of the XSocket library.
XSocket seems to refer to Java RMI which is not supported by Android.
If you want to try the Mina-based API drop us an email and we'll send the jars. It won't require any changes in your code, just replacing the references to the external libraries in your IDE
Hope it helps
We have an alternative version of XMLSocket library which uses Apache Mina instead of the XSocket library.
XSocket seems to refer to Java RMI which is not supported by Android.
If you want to try the Mina-based API drop us an email and we'll send the jars. It won't require any changes in your code, just replacing the references to the external libraries in your IDE
Hope it helps
Return to “Java2SE / Android Client API”
Who is online
Users browsing this forum: No registered users and 47 guests