Well, actually you can pass a lot more than just Strings to a Activity
onCreate, but that's not what you should do here. I think I would
write a Service to provide server communication. Any of your
activities could then access this service.

On Apr 6, 1:09 pm, colintheprep <[EMAIL PROTECTED]> wrote:
> Hi all, I'm looking for suggestions on how to architect something:
>
> My application consists of a number of activities, most of which talk
> to the network (through tcp sockets).  I.e. - one activity connects to
> the network, sends and receives some stuff, launches another activity,
> which also sends and receives some stuff, etc.
>
> What would be the best way to encapsulate the 'network communicator'
> portion, so that all activities can talk to the network through the
> same socket?  I can't pass objects to activity's create methods, only
> strings, right?  So I can't pass a 'networkcommunicator' object - only
> an ip address, credentials, etc.  Would it be better to set up a
> service or intent receiver or something like that, and then all
> activities talk to the network through it?  Or some other way?
>
> As an aside, is it bad in any way to maintain a connected socket
> through different activities in such a way (whatever way that would
> be)?
>
> thanks for the feedback!
>
> Colin
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to