Loris Anoardi Member Licensed User Longtime User Mar 8, 2016 #1 my network calls are managed in a service module (Tcp socket server used for receiving messages from a windows pc). How can i use a separate thread without changing the sdk version to 8? Is there an example? thanks
my network calls are managed in a service module (Tcp socket server used for receiving messages from a windows pc). How can i use a separate thread without changing the sdk version to 8? Is there an example? thanks
Erel B4X founder Staff member Licensed User Longtime User Mar 8, 2016 #2 Network calls should never be done on the main thread. How are you implementing those calls? You should use AsyncStreams. It doesn't matter whether the code is in a service or activity. Upvote 0
Network calls should never be done on the main thread. How are you implementing those calls? You should use AsyncStreams. It doesn't matter whether the code is in a service or activity.
Loris Anoardi Member Licensed User Longtime User Mar 8, 2016 #3 Thanks Erel do you mean this? https://www.b4x.com/android/forum/threads/asyncstreams-tutorial.7669/#content Upvote 0
Thanks Erel do you mean this? https://www.b4x.com/android/forum/threads/asyncstreams-tutorial.7669/#content
Loris Anoardi Member Licensed User Longtime User Mar 8, 2016 #5 Erel i get this error: java.lang.RuntimeException: Message size too large. Prefix mode can only work if both sides of the connection follow the 'prefix' protocol. i tried to look in some posts but i didnt understand what i shoud do to solve. I need only to send a string... Upvote 0
Erel i get this error: java.lang.RuntimeException: Message size too large. Prefix mode can only work if both sides of the connection follow the 'prefix' protocol. i tried to look in some posts but i didnt understand what i shoud do to solve. I need only to send a string...
Loris Anoardi Member Licensed User Longtime User Mar 8, 2016 #6 Solved !!! i should use async.initialize instead of async.initializeprefix Upvote 0