Well... it appears it's possible to write code that lets you marshal
your complicated data structures, but it looks like something of a
pain, and might not even really let you do what you need unless you
simply wedge the whole thing into a screen.
I'm having some difficulties with this myself, with Hecl. I have an
interpreter that I'd like to pass around in order to not have to
create a new one for each activity. Furthermore, the interpreter is
not something that ought to disappear when the activity gets frozen:-/
--
David N. Welton
Also, please correct me if I'm wrong, if the
android.os.Message/Handler is used as the communication
technique then there are no issues with multi-threading
as only one message at a time will ever "handled".
So the OP may still need or want to run in different
processes, do you have any advice on how this may be
done?
Regards,
Wink Saville
"Note that services, like other application objects, run
in the main thread of their hosting process"
Although I don't see a list of "application objects" except an off
handed mention at
http://code.google.com/android/reference/android/os/Handler.html
where it says:
"When a process is created for your application, its main thread is
dedicated to running a message queue that takes care of managing
the top-level application objects (activities, intent receivers, etc) and
any windows they create."
It would be nice if we this was somewhat more explicit.
BUT, I also some conflicting information:
In rereading "Lifecyle of an Android Application" here
http://code.google.com/android/intro/lifecycle.html
it mentions 5 "processes": foreground, visible, service, background & empty.
In this context I would assume a "process" was a separate address
space, but at least a separate thread.
Then, in the documentation for Activity the "Process Lifecycle" section of
http://code.google.com/android/reference/android/app/Activity.html
talks about 3 "activities" and 1 process: foreground, visible,
background & empty,
(Note: Service is missing, is the a documentation error or is "Process
Lifecycle"
different from an Application Lifecycle?)
Anyway, here it says "The system will kill less important processes..."
which
implies to me that they are each a "activity/process" is a linux
process (i.e. a different address space).
So now I'm really confused, hopefully you can set me straight.
Thanks,
Wink Saville
I'm still fuzzy on how the system can "kill less important processes"
but its probably not important just yet, but someday I
suspect it will be:)
Cheers,
Wink Saville