Basic Connection Example in Android Not Working

Post here all your questions related with SmartFoxServer Java API

Moderators: Lapo, Bax

Polyclef
Posts: 4
Joined: 08 Sep 2009, 15:36

Basic Connection Example in Android Not Working

Postby Polyclef » 08 Sep 2009, 15:43

I've been developing on Android for about 6 months now, and I'm looking to implement multiplayer versions of some of my games, and I found SFS. Looks cool, but I can't get past the first example.

I successfully downloaded and installed SFS Lite on my Windows XP Professional machine. The server starts up just fine. I run the Basic Server Connection example for Android, and I get stuck at "Connecting..."

I was initially trying the example from my G1, and from an emulator on another machine, but when that didn't work, I tried it on the emulator on the same machine that's running the server. Still won't work. Any ideas?

Thanks for any help.

UPDATE: When I run the sample Flash applications, such as simpleConnection or simpleChat, on the same machine as the server, they connect just fine. Android apps running in an emulator on the same machine as the server, attempting to connect to the same address "127.0.0.1" time out and cannot connect.
patso
Posts: 380
Joined: 13 Nov 2006, 13:44
Location: Sofia, Bulgaria

Postby patso » 09 Sep 2009, 08:18

The android emulator runs behind virtual router so 127.0.0.1 does NOT point to the developer machine. The default ip in the example - 10.0.0.2 points to 127.0.0.1 on the developer machine - more you can read here - http://developer.android.com/guide/developing/tools/emulator.html#emulatornetworking

Also please note that java API is not compatible with the lite version - only with basic and pro.
Polyclef
Posts: 4
Joined: 08 Sep 2009, 15:36

Postby Polyclef » 09 Sep 2009, 13:13

That makes perfect sense. I wondered why the IP address in the Android chat demo was not 127.0.0.1. :)

I guess I missed that tidbit, and also the fact that the Java API doesn't work with SFS Lite. I'll download a trial version of Basic and give it a shot.

Thanks for the reply.

UPDATE: Got it working fine now with the trial version of SFS Basic. Guess it's time to start working the API and seeing what I can do.

Return to “Java2SE / Android Client API”

Who is online

Users browsing this forum: No registered users and 15 guests