Basic Connection Example not working for android

Post here your questions about the Java client / Android API for SFS2X

Moderators: Lapo, Bax

Post Reply
ashwanik
Posts: 4
Joined: 18 May 2011, 09:41

Basic Connection Example not working for android

Post by ashwanik »

I am new to android environment but have experience of Java. I am trying to make a multiplayer game for android environment. But when I try to run Basic Connection example in android emulator it says that app has crashed. On checking the log files for the same I found that it gives java null pointer exception for sfs.connect("10.0.2.2"). Please help me to solve this problem.
janux
Posts: 28
Joined: 21 Sep 2010, 19:11

Re: Basic Connection Example not working for android

Post by janux »

ashwanik wrote:I am new to android environment but have experience of Java. I am trying to make a multiplayer game for android environment. But when I try to run Basic Connection example in android emulator it says that app has crashed. On checking the log files for the same I found that it gives java null pointer exception for sfs.connect("10.0.2.2"). Please help me to solve this problem.
Check that your server runs on IP 10.0.2.2.
ashwanik
Posts: 4
Joined: 18 May 2011, 09:41

Post by ashwanik »

Server should run on 127.0.0.1 or 10.0.2.2? Isn't it that 10.0.2.2 is loop back interface for android emulator so I must run my server on my local host only? I have tried both but still getting the same response and app crashes.

Please help what should I do? I have installed SFS2X and downloaded Java API. I have not changed anything in that but still it does not run.
Post Reply