On Thu, May 3, 2012 at 11:20 AM, Ryan Groten <rgro...@gmail.com> wrote:
> I have a standard java server listening for connections from "clients"...in
> this case a client could be a straight java web client OR a android device
> client.  Because of this I have two separate projects (one for the java
> client, one for the android client).  Clients use sockets to pass java
> objects back and forth with the server...I want to be sending the SAME
> object to the server regardless of which client it comes from.  So I built
> an object class and attempted to link both client projects to it.  The java
> client works fine, but I can't figure out how to make the android client
> work with the object.  If I take that class and put it in the android
> project then the android client works...but the server then doesn't know
> what the object is and it dies.

Put the "object class" in a separate JAR, and use that JAR on both
your client and your server.

> Maybe I shouldn't be sending objects in the first place?

I would recommend you choose a platform-and-language-neutral,
easier-to-debug, easier-to-version on-wire encoding, such as JSON or
XML. Or, if you insist that it has to be binary, choose Apache Thrift
or Protocol Buffers.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training...At Your Office: http://commonsware.com/training

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to