Problem with PubSub on Android

#1

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? :slight_smile:

Tested on Android 4.03 and 2.3.4

0 Likes

#2

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

路路路

Am 25.01.2012 15:30, schrieb Magnus Johansson:

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? :slight_smile:

Tested on Android 4.03 and 2.3.4

0 Likes

#3

Don't be sorry :slight_smile: You're doing great work here
Thanks for the prompt reply

/Magnus

路路路

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

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

Am 25.01.2012 15:30, schrieb Magnus Johansson:

> 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? :slight_smile:

> Tested on Android 4.03 and 2.3.4

0 Likes

#4

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

Am 25.01.2012 17:37, schrieb Magnus Johansson:

Don't be sorry :slight_smile: You're doing great work here
Thanks for the prompt reply

/Magnus

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

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

Am 25.01.2012 15:30, schrieb Magnus Johansson:

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? :slight_smile:
Tested on Android 4.03 and 2.3.4

0 Likes

#5

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

0 Likes

#6

Great to hear it run on other Android versions! Thanks for testing/
reporting ..

rgd buffer sizes .. yes

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

0 Likes

#7

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()

路路路

On Jan 26, 12:04 pm, tgo <tobias.o...@gmail.com> wrote:

Great to hear it run on other Android versions! Thanks for testing/
reporting ..

rgd buffer sizes .. yes

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

0 Likes

#8

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

路路路

Am 13.02.2012 14:42, schrieb Andre P LeBlanc:

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()

On Jan 26, 12:04 pm, tgo<tobias.o...@gmail.com> wrote:

Great to hear it run on other Android versions! Thanks for testing/
reporting ..

rgd buffer sizes .. yes

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

0 Likes