Problems building Connection example

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

Moderators: Lapo, Bax

lhartzman
Posts: 2
Joined: 27 Jun 2012, 19:17

Problems building Connection example

Postby lhartzman » 27 Jun 2012, 19:24

I downloaded the Android SDK and the Android Eclipse Plugin. I'm getting an error on the 'dispatch' method (and others) saying that method must override a superclass method. The same thing is happening with onCancel, onClick, and others.

I know this is a configuration problem, but I'm not sure what I've got to add and from what library.

All help appreciated.

Thanks.

Les
User avatar
Lapo
Site Admin
Posts: 21012
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Problems building Connection example

Postby Lapo » 28 Jun 2012, 17:44

Hi,
I have already replied to the other post which seems very similar to this one.
Please follow the instructions here:
http://docs2x.smartfoxserver.com/Exampl ... /connector

If you face problems please tell us which errors do you see. Thanks
All the examples should work out of the box if you follow the example tutorials.
Lapo
--
gotoAndPlay()
...addicted to flash games
jander
Posts: 3
Joined: 16 Jul 2012, 04:38

Re: Problems building Connection example

Postby jander » 16 Jul 2012, 04:47

Hi

I'm facing the same problem. As far as I can tell, I followed all instructions in the docs2x pages.

The problem seems to be that when Runnable is instatiated (in the dispatch method), the run method must be implemented and not overrided.

I'm missing something?

Eclipse SDK 4.2.0
Android SDK revision 20
Emulated Phone with Android 2.3.3

Thanks,

Jander
jander
Posts: 3
Joined: 16 Jul 2012, 04:38

Re: Problems building Connection example

Postby jander » 27 Jul 2012, 15:21

Hey,

I'm not sure why, but the following procedure solved the problem for me.

1. Locate all @Overrides with errors and remove them. This wil remove all compile time issues, but the program will not work yet.

2. Change the name of the lib folder to libs. Eclipse will complain now about the missing libraries.

3. Fix the build library path (right click project name, and choose Properties > Java Build Path, and open Libraries). Select all JARs, except Android 2.3.3 (for me) and Android Dependencies, and remove them. Click on Add JARs..., browse to the recently renamed libs folder and select all JARs in it. Click OK.

4. Run your application and be happy.

It worked like a charm for Connector, Simple Chat, and Tris.

Hope this helps.

Jander

Return to “SFS2X Java / Android API”

Who is online

Users browsing this forum: No registered users and 1 guest