Hello Andrew,
how did you implement the activity stuff?
I´ve a MainApplication instance which is reachable via
TinyIoC.TinyIoCContainer.Current.Resolve<IMainApplication>().
I´ve added List<Activity> Activities to he IMainApplication interface.
In each activity I´ve add
mainApp.Activites.Add(this) into the OnCreate method
and mainApp.Activities.Remove(this) into the OnDestroy method.
Is it what you mean?
Regards,
Carlo
Von: Andrew Sinclair [via Mono for Android]
[mailto:ml-node+4631540-1678032272-202...@n5.nabble.com]
Gesendet: Montag, 25. Juli 2011 19:01
An: cbolz
Betreff: Re: Runtime reliability?
>> who else has problems with the runtime reliability?
Me!
>> Are there any traps to avoid? Are there any workarounds? Are there any tips
>> and tricks?
I've found 2 things that made my app more reliable (NB. "more reliable" not
"totally reliable")...
· I had a tight loop calling RunOnUiThread to update an activity when
performing a background task. For a long-running task this sometimes caused a
crash (NB. not an application level exception, just the usual "app has died").
Suppose this tried to perform 5,000 UI updates in 1 minute - 80% of the time
the app would crash doing this. I changed the updates to be only 10% of this -
app has never crashed since. The crash was always associated with a GC_EXPLICIT
in the logs.
· I had a number of activities using StartActivityForResult. At
seemingly-random times in the activity lifecycle the app would die. I changed
the app to hold a reference to each activity globally, in order to inhibit the
GC (not a good idea I know). This increased reliability significantly. To me it
"felt" like activities were being GC'd before OnDestroy was called, but that's
guesswork.
Both of these made a significant improvement for me. As a programmer it's
always a worry that it's something you are doing wrong that is causing the
problem. But in these cases I'm pretty sure that the bug(s) are not at the
application level, probably something GC-related to account for the apparent
randomness. Bugs in the app itself are always accompanied by "normal"
exceptions which you can debug in the usual way.
I don't suggest that these changes would work for anybody else, they're
workarounds that helped for me but which don't remove the fundamental problem.
It's like squashing a bump on a carpet - you think everything is nice and flat
but then you notice you just moved the bump somewhere else‼
I am very, very eagerly awaiting the next Mono for Android release ;-)
Hope this helps.
Cheers,
Andy
-----------------
I´ve my back to the wall.
Regards,
Carlo
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/Runtime-reliability-tp4630731p4630731.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[hidden email]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
_______________________________________________
Monodroid mailing list
[hidden email]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
_____
If you reply to this email, your message will be added to the discussion below:
http://mono-for-android.1047100.n5.nabble.com/Runtime-reliability-tp4630731p4631540.html
To unsubscribe from Runtime reliability?, click here
<http://mono-for-android.1047100.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4630731&code=Y2JAZG0tZWR2LmRlfDQ2MzA3MzF8LTEzNTc1Njk1Njc=>
.
--
View this message in context:
http://mono-for-android.1047100.n5.nabble.com/Runtime-reliability-tp4630731p4633966.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid