Michal,

I could think of to implement a dispatcher mechanism  in your thread
where you receive the incoming messages.

I assume that you know which traffic should be routed to which
activity, correct?

You could put the incoming message with an destination identifier
(identifier for the activity) in an thread safe container which is
accessible by the different activities (for example queue record: dest
id, message data).

After the message is placed on a message queue, contact the
corresponding activity that data is in the message queue. The
destination activity would loop through the message queue and be able
to find the incoming messages based on the destination identifier.

--
Roman Baumgaertner
Sr. SW Engineer-OSDC
·T· · ·Mobile· stick together
The views, opinions and statements in this email are those of the
author solely in their individual capacity, and do not necessarily
represent those of T-Mobile USA, Inc.




On Oct 30, 1:03 am, Michal <[email protected]> wrote:
> Hi all,
>
> I have a question concerning the following situation:
>
> 1. I'm developing a client server application using TCP/IP Sockets.
> 2. Android application is a client which is composed of many
> activities.
> 3. There is one dedicated thread created in android app for receiving
> messages from server.
>
> How to manage many activities in this receiving thread in a way that
> an incoming message will be passed to a proper activity (the one which
> is currently active)?
>
> I would appreciate any advice.
>
> BR,
> Michal

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to