Kryonet on android

307 views
Skip to first unread message

mmikalsen

unread,
Oct 29, 2009, 5:59:01 PM10/29/09
to kryonet-users
Hey

Im currently messing around with this library in my java network
programming class. spesifically the RMI part. And i must say it works
great. But ive been trying to modify the rmi chat example to work on
android, and im having some problems. Just wondering if anyone else
has tested it on android? Its probably just my total inexperience
coding on android.

/mmikalsen

Nate

unread,
Oct 29, 2009, 8:17:50 PM10/29/09
to kryonet-users
I've used the core of KryoNet on Android. I'll test out the RMI bit
and see if it works there. Do you have an exception?

-Nate

mmikalsen

unread,
Nov 1, 2009, 5:02:40 PM11/1/09
to kryonet-users
I got a nullpointer exception in the client thread. but i found out if
was because it could not connect to the server.
since i was missing

<uses-permission android:name="android.permission.INTERNETT" />

in the project manifest file. Now that i got that sorted it works.

Do you think RMI with your library would be a good way to go when
making a network android game?

/mmikalsen

Nate

unread,
Nov 1, 2009, 10:05:09 PM11/1/09
to kryone...@googlegroups.com
Cool, glad you got it worked out. Did you make the chat example work
on Android? That would be a nice addition to the KryoNet examples! :)

There is a slight overhead to using RMI versus sending objects
explicitly. Each remote method call has an additional overhead of
(usually) 4 bytes to encode: what object, what method on that object,
and a response ID. 4 bytes isn't a huge deal at all, but not using RMI
and just sending an object is slightly more efficient.

If you are writing a real time game (which is already tough to do on
Android) then you probably want to be as efficient as possible.
Otherwise, go ahead and use RMI if you find it easier to use for a
given scenario. You can also use both at the same time if you'd like.

-Nate

mmikalsen

unread,
Nov 3, 2009, 1:03:20 PM11/3/09
to kryonet-users
Yup. it worked. But its very unfinished. I just used it to see if i
could get the network part working
so i can use that in an assignment i got in my network programming
course. To make a cinema
seat reservation application with RMI.

I can fix it up a bit and mail it to you.

/mmikalsen

Nate

unread,
Apr 5, 2010, 1:02:32 AM4/5/10
to DammitDarrell, kryone...@googlegroups.com
As of SVN 91 Kryo and KryoNet again work on Android.

FieldSerializer falls back to using reflection on Android. It would be nice to do code generation there, too. Kryo now uses ReflectASM for the code generation reflection replacement. It would be nice to update ReflectASM so it works on Android.

-Nate


On Mon, Mar 29, 2010 at 10:13 PM, DammitDarrell <darr...@gmail.com> wrote:
Heads up Android users:

Due to the addition of the dependency on org.objectweb.asm jar,   the
last version of KyroNet that works on android is 0.9.  The problem is
that the fancy class-file rewriting stuff in ASM is not designed for
the dalvik class file format.   I tried to get 1.0 to work by using
the port of org.objectweb.asm  that is in the android-scripting
project, but it is not a complete port and is currently missing some
needed classes.

If I figure out a workaround I will share it here.



On Nov 1 2009, 9:05 pm, Nate <nathan.sw...@gmail.com> wrote:
> Cool, glad you got it worked out. Did you make the chat example work
> onAndroid? That would be a nice addition to the KryoNet examples! :)

>
> There is a slight overhead to using RMI versus sending objects
> explicitly. Each remote method call has an additional overhead of
> (usually) 4 bytes to encode: what object, what method on that object,
> and a response ID. 4 bytes isn't a huge deal at all, but not using RMI
> and just sending an object is slightly more efficient.
>
> If you are writing a real time game (which is already tough to do onAndroid) then you probably want to be as efficient as possible.

> Otherwise, go ahead and use RMI if you find it easier to use for a
> given scenario. You can also use both at the same time if you'd like.
>
> -Nate
>
> On Sun, Nov 1, 2009 at 2:02 PM, mmikalsen <mmikal...@gmail.com> wrote:
>
> > I got a nullpointer exception in the client thread. but i found out if
> > was because it could not connect to the server.
> > since i was missing
>
> > <uses-permissionandroid:name="android.permission.INTERNETT" />

>
> > in the project manifest file. Now that i got that sorted it works.
>
> > Do you think RMI with your library would be a good way to go when
> > making a networkandroidgame?
>
> > /mmikalsen
>
> > On Oct 30, 1:17 am, Nate <nathan.sw...@gmail.com> wrote:
> >> I've used the core of KryoNet onAndroid. I'll test out the RMI bit

> >> and see if it works there. Do you have an exception?
>
> >> -Nate
>
> >> On Oct 29, 2:59 pm, mmikalsen <mmikal...@gmail.com> wrote:
>
> >> > Hey
>
> >> > Im currently messing around with this library in my java network
> >> > programming class. spesifically the RMI part. And i must say it works
> >> > great. But ive been trying to modify the rmi chat example to work on
> >> >android, and im having some problems. Just wondering if anyone else
> >> > has tested it onandroid? Its probably just my total inexperience
> >> > coding onandroid.
>
> >> > /mmikalsen

Reply all
Reply to author
Forward
0 new messages