سؤال

I thank everyone that helped me on my last question. I have been reading a lot about Android programming and backgrounding tasks and I have a few doubts about this diagram: http://docs.xamarin.com/guides/cross-platform/application_fundamentals/backgrounding/part_9_android_backgrounding_guidance/Images/image22.png

Which can be found on : http://docs.xamarin.com/guides/cross-platform/application_fundamentals/backgrounding/part_9_android_backgrounding_guidance/

  1. According to the diagram if I want to do cleanup tasks on an Activity I should de them on the "OnPause" event but make it fast: if it thakes them a long time it will freeze the layout? Is there a chance my app will be forcefully finished before the cleanup can finish?

  2. Why I don't want to run a task on an Activity when it is backgrounded? At first I thought that it was because it would stop working but I see that if I don't stop my code it will keep running but it is not the case. Why should I use a service if a I can keep doing tasks even if my Activity is backgrounded?

  3. In the case of the remote services branch of the diagram: the Messenger serves what purpose other than send Messages to the Service? Can I receive information from the service using Messages or I need another way to get answers from the service?

  4. Another about remote: I read the AIDL that is mentioned is not supported by Xamarin at the moment, how can I implement it?

  5. In the case of starting a long-running task: I should use a service so to ensure that my task will be done?

  6. How can I start a Service at device boot-up?

  7. If Android forces a sticky service to restart: all objects bound to it are still bound? Or I have to bound them again?

  8. Can I send objects to a Service?

I know, a lot of questions. Most of them were asked by my boss so I want to give him the best answers.

Thanks in advance!!!

[Edit: 20140320] Some answers, if I am wrong please tell me.

  1. Android can Destroy backgrounded activities if it sees fit.

  2. Same as 1

  3. Do any of you have a nice example using Server Messengers in Xamarin?

  4. Guess that it is same as 1 and 2. A backgrounded Activity will be destroyed if Android sees fit. A Service could survive more than the calling activity.

هل كانت مفيدة؟

المحلول

[Edit: 20140320] Some answers, if I am wrong please tell me.

Android can Destroy backgrounded activities if it sees fit.

Same as 1

Do any of you have a nice example using Server Messengers in Xamarin?

Guess that it is same as 1 and 2. A backgrounded Activity will be destroyed if Android sees fit. A Service could survive more than the calling activity.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top