Hey guys,

I'm running out of ideas and could not find any help by searching the
web so I'm trying to get some help this way. It's like this:

We have an application, that basically consists of one service and one
activity. The activity binds to the service and keeps the Binder
reference that is passed by the onServiceConnected method. Through
this reference the Activity can access some objects that are held by
the service. The service, however, only updates the Activity by using
the Messenger/Handler concept described here
http://developer.android.com/guide/topics/fundamentals/bound-services.html
(Using a Messenger).

The application runs for several (5 to 10) hours and then it freezes.
During the whole time, nobody touched the phone. I can still use home
and power buttons and sometimes the ANR dialog comes up but not until
I touched the screen or changed the orientation. The logcat then shows
FAILED BINDER TRANSACTION every some milliseconds but nothing else
that could help me. The custom log from the service tells me that the
onPause, onStop, onDestroy methods were not called and no uncaught
exception was fired as I registered a handler to this event. As it
takes so long for the error to occur, I have not been able to see it
happening in the log. Before going into further details of the
architecture:

   - what are the basic rules to obey to not run into that error? I
have read that I should not keep Context objects as members. What
about the service? Some classes that are instantiated by the service
needs access to the context to e.g. get a system service. Therefore
the service implements an interface that it passed to those created
objects and, of course, they keep it as a member. Do I need to avoid
that?
   - I included a thread that asks the ActivityManager for lowMemory
state on regular bases but that did never occur, so I ruled out Memory
leaks ... for now.
   - The application is not handling large images or large byte
arrays.
   - The service (or subclasses) registers receiver to the Battery and
Time changed events and also requests location updates from GPS. Any
known problems with that?
   - I tested the application on 4 different phones, 3 HTC sensation
and 1 HTC Desire HD. It's the same on every phone.
   - I am using monodroid from xamarin (http://android.xamarin.com/
Welcome) - please don't tell me to not use it. I know it is not the
best approach but in my company we don't have another option right
now. Still, any known problems relating to it?

I really hope someone has an idea and thanks in advance for reading
Christian

-- 
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