I think I have discovered the reason for my troubles. I also think
that the relationship to the media process was incidental.

What I really think is going on is related to the OS reclaiming
memory.

When I leave my app in the foreground (i.e. visible) it works (and "It
Won't Die, Jim") -- if I use the BACK BUTTON to push it into the
background, it *may* die, and I am convinced it is at the hands of the
OS in its memory reclamation process… I assert this as my experiments
have shown that on a device with LOTS O' memory the app works
flawlessly… on a device with less memory it will almost certainly die
---- and I can guarantee to kill it if I start using the devices other
apps.

The rub here is that I NEED my app to reside in the background (or at
least my SMS BROADCAST RECEIVER class) .. I want the user to be able
to "use" his phone for other things while my app awaits a signaling
SMS. At that point I use a "notification" to get the user's attention.

I am hoping someone may respond and say … "Well, all-you-gotta-do is
Blah_Blah…"  Is there a way to make the OS "not" clean me out of
memory? Is the answer to make the b-receiver a "service"? And is that
allowable in Android?

On Sep 6, 10:56 am, tony obrien <[email protected]> wrote:
> Hi,
>
> I have seen one reference to this sort of problem where a MAIN app
> dies because :::
>
> "because provider com.android.providers.media.MediaProvider is in
> dying process android.process.media"
>
> In that reference the implication was that if you held a CURSOR "too
> long"  this could happen.
>
> I am not using any explicit cursor, but maybe there is an implied one
> somehere?
>
> Hopefully these code snips will provide someone enough incite to offer
> a solution.
>
> I use a RINGTONE PICKER ==>
>
>                                 String uri = null;
>                                 Intent intent = new
> Intent( RingtoneManager.ACTION_RINGTONE_PICKER);
>
> intent.putExtra( RingtoneManager.EXTRA_RINGTONE_TYPE,
> RingtoneManager.TYPE_NOTIFICATION);
>
> intent.putExtra( RingtoneManager.EXTRA_RINGTONE_TITLE, "Select Tone");
>                                 if( uri != null)
>                                 {
>
> intent.putExtra( RingtoneManager.EXTRA_RINGTONE_EXISTING_URI,
>                                     Uri.parse( uri));
>                                 }
>
>                                 else
>                                 {
>
> intent.putExtra( RingtoneManager.EXTRA_RINGTONE_EXISTING_URI,
>                                     (Uri)null);
>                                 }
>                                 startActivityForResult( intent,
> Set_Ringtone);
>
> And catch the result::::
>
> @Override
>     public void onActivityResult(int reqCode, int resultCode, Intent
> data) {
>         super.onActivityResult(reqCode, resultCode, data);
>
>         if (resultCode == RESULT_OK) {
>             Uri uri =
> data.getParcelableExtra(RingtoneManager.EXTRA_RINGTONE_PICKED_URI);
>             if (uri != null) {
>                 MainActivity.ringTonePath = uri.toString();
>             }
>
>         }
>     }
>
> At some time later, I call a sound class to play the selected
> ringtone :::
>
>             Ringtone myr =  RingtoneManager.getRingtone(context,
> Uri.parse( MainActivity.ringTonePath));
>             if (MainActivity.doDebug) Log.d("FPH", "clsSound:Play
> RINGTONE");
>             myr.play();
>             return;
>
> This is called repeatedly while a flag is TRUE (until the user sets it
> FALSE)
>
> At this point the App is sitting essentially idle  --- and if the
> android.process.media dies (say by force) then so do I. But I do not
> understand why I should die.
>
> Any ideas?
> thanks,
> tob

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