You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating a connection in Android activities in onCreate (like shown here http://jfarcand.wordpress.com/2013/04/04/wasync-websockets-with-fallbacks-transports-for-android-node-js-and-atmosphere/) the exception android.os.NetworkOnMainThreadException is thrown. wasync seems to invoke networking methods not on in a background thread.
While it is possible and trivial to do the connection set up in the background the expectation is that an synchronous librarylike wasync does all networking in a background thread.
This would simplify the usage of this library.
The text was updated successfully, but these errors were encountered:
On newer versions of Android there is a policy which prohibits all network activity on the UI thread. In case you call any method related to networking like opening sockets or using URLConnection.open an exception is thrown.
It seems that wAsync does some networking on Socket.open before everything else is handled in the background. On other platforms this might not be a problem, but Android is very strict with these things.
Threading in general is a bit tricky, since the results must be delivered back to the UI on the UI thread.
In the long run it could be nice for developers to have some kind of "wrapper" for wAsync on Android which handles threading and delivery of results in the correct threads.
When creating a connection in Android activities in onCreate (like shown here http://jfarcand.wordpress.com/2013/04/04/wasync-websockets-with-fallbacks-transports-for-android-node-js-and-atmosphere/) the exception android.os.NetworkOnMainThreadException is thrown. wasync seems to invoke networking methods not on in a background thread.
While it is possible and trivial to do the connection set up in the background the expectation is that an synchronous librarylike wasync does all networking in a background thread.
This would simplify the usage of this library.
The text was updated successfully, but these errors were encountered: