Problem with PubSub on Android

219 views
Skip to first unread message

Magnus Johansson

unread,
Jan 25, 2012, 9:30:59 AM1/25/12
to Autobahn
Hi,

I´ve been playing around with the PubSub tutorial -
http://www.tavendo.de/autobahn/tutorial/pubsub.html
I have the python server up and running and it works fine with the JS
client.
My issues is with the Android client. It connects - but closes the
connection right away with error code 3.
Anyone with similar issues? Any suggestions on how to get the Android
pubsub example running? :)

Tested on Android 4.03 and 2.3.4

Tobias Oberstein

unread,
Jan 25, 2012, 11:23:20 AM1/25/12
to autob...@googlegroups.com, Magnus Johansson
Hello Magnus,

the Android client is right now a little bit behind the WAMP
implementation of Python (client and server) and JS.

WAMP is still evolving .. we've added some small features .. I guess
what it breaks is the initial WAMP welcome
message that contains a unique random session ID, which is used for

- exclude individual clients from receivers when publishing
- (optionally) for client authentication purposes

I'll fix it shortly (tomorrow or day after ..)

I report here when its ready again .. sorry.

Tobias

Magnus Johansson

unread,
Jan 25, 2012, 11:37:29 AM1/25/12
to Autobahn
Don't be sorry :) You're doing great work here
Thanks for the prompt reply

/Magnus

On Jan 25, 5:23 pm, Tobias Oberstein <tobias.oberst...@gmail.com>
wrote:

Tobias Oberstein

unread,
Jan 25, 2012, 5:56:57 PM1/25/12
to autob...@googlegroups.com, Magnus Johansson
ok, it's fixed .. actually 2 small issues

https://github.com/oberstet/AutobahnAndroid/issues/2
https://github.com/oberstet/AutobahnAndroid/issues/3

I have tested it using

Android 2.3.3
AutobahnAndroid _current_
Autobahn _current_

It should work with Android >= 2.2 and also the latest Autobahn release
(0.4.10).

==

If you have Android 4.x devices (or other versions), I'd be glad to hear
if that works also.

==

Please note: I did not update the AutobahnAndroid JAR (yet) .. its
somewhat annoying / error prone
to do manually. You need to use the source.

Should you - by chance - know how to automate that, I'd be happy to hear!

https://github.com/oberstet/AutobahnAndroid/issues/4

==

Should you run into problems, feel free to ask .. AutobahnAndroid is
still beta (unlike AB Py, which is
quite mature) .. issues will arise.

/Tobias

Magnus Johansson

unread,
Jan 26, 2012, 5:55:40 AM1/26/12
to Autobahn

Thanks! Now it works on Android 4.03 (Nexus S) and 2.3.4 (Galaxy mini)

Also tried it on a HTC Legend (2.2) (16Mb max heap) but those 4Mb
allocations for read and write buffers kills it on devices with low VM
heap size.
Doesn't really matter to me but may be a problem for others

AutobahnAndroid _current_
Autobahn 0.4.10

/Magnus

tgo

unread,
Jan 26, 2012, 12:04:09 PM1/26/12
to Autobahn
Great to hear it run on other Android versions! Thanks for testing/
reporting ..

rgd buffer sizes .. yes

https://github.com/oberstet/AutobahnAndroid/issues/5

Andre P LeBlanc

unread,
Feb 13, 2012, 8:42:52 AM2/13/12
to Autobahn
When you ran on android 4.0+ were you working in a background thread
for your initial connection? I have been trying to get it working on
4.0 but I keep getting a NetworkOnMainThreadException when I
call .connect()

Tobias Oberstein

unread,
Feb 13, 2012, 8:53:21 AM2/13/12
to autob...@googlegroups.com, Andre P LeBlanc
No, me _myself_ did not try anything but 2.2/2.3 ..

I now included startup code like

http://android-sdk.appspot.com/reference/android/os/StrictMode.html

and I can see the violation even on 2.3

D/StrictMode(11924): at
de.tavendo.autobahn.WebSocketConnection.connect(WebSocketConnection.java:194)

It's like I suspected .. the initial socket connect is the source of
evil (the background readers/writers thereafter
are no problem and work as expected).

Thus:

We need to do the initial socket connect already on a short-lived
background thread.

This is a high-prio problem ..

https://github.com/oberstet/AutobahnAndroid/issues/6

and I will fix it very soon .. however I need a 3+/4 device first;)

So lets say next week ..

\Tobias

Reply all
Reply to author
Forward
0 new messages