[android-developers] Re: Two things holding up my app. Any suggestions?

2012-06-22 Thread String
On Wednesday, June 20, 2012 5:06:24 PM UTC+2, Shino wrote:

For my second issue... Accessing an AsyncTask from a Notification's 
 PendingIntent ... Could I put a BroadcastReceiver in the AsyncTask then 
 send a broadcast on user interaction with the dialog?  That was the next 
 option I was going to try... I just haven't had time to implement it yet.


I can't say I've tried this specific situation, but I 
create BroadcastReceivers all over my code, and I'd be quite surprised if 
this doesn't work.

If (for some reason) it doesn't, though, an alternative would be to use a 
background Service rather than an AsyncTask. You can definitely create 
a BroadcastReceiver in a Service like this. And arguably, if you're going 
to be attaching to it from places other than the Activity that created it, 
a Service is a better architecture than an AsyncTask anyway. Not saying you 
should rebuild it if the AsyncTask is working for you, though.

String 

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Two things holding up my app. Any suggestions?

2012-06-22 Thread Shino
Thanks String for the info.  This is all pretty new to me and though I have 
been in development for a long time, I'm still learning Android best 
practices.
I'm going to try the Broadcast and see if that works with the AsyncTask.  
If it doesn't, I will turn the AsyncTask into a Service and try again.  
That shouldn't be too hard to do.

As for the media player... I've pretty much given up on using the default 
one.
I'm going to get it out to the beta testers and just tell them that I'm 
working on a custom media player to play the audio.
Maybe with the player controls in the notification bar or something.

On Friday, June 22, 2012 6:33:37 AM UTC-4, String wrote:

 On Wednesday, June 20, 2012 5:06:24 PM UTC+2, Shino wrote:

 For my second issue... Accessing an AsyncTask from a Notification's 
 PendingIntent ... Could I put a BroadcastReceiver in the AsyncTask then 
 send a broadcast on user interaction with the dialog?  That was the next 
 option I was going to try... I just haven't had time to implement it yet.


 I can't say I've tried this specific situation, but I 
 create BroadcastReceivers all over my code, and I'd be quite surprised if 
 this doesn't work.

 If (for some reason) it doesn't, though, an alternative would be to use a 
 background Service rather than an AsyncTask. You can definitely create 
 a BroadcastReceiver in a Service like this. And arguably, if you're going 
 to be attaching to it from places other than the Activity that created it, 
 a Service is a better architecture than an AsyncTask anyway. Not saying you 
 should rebuild it if the AsyncTask is working for you, though.

 String 


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Two things holding up my app. Any suggestions?

2012-06-21 Thread Shino
Bump?
Can anyone help me out with this?

I'm working on using MediaPlayer, but I need to get this out.

It just seems like the 2 things I'm asking about shouldn't be complicated 
to do but they are, and here and on StackOverflow, I have yet to get 
answers that work.
:(

On Wednesday, June 20, 2012 11:06:24 AM UTC-4, Shino wrote:

 @Sauray ... I did not think of that.  I guess my question would be... 
 since after the player is launched they are now actually outside of my app, 
 do I even have control over the back button at that point?

 @Chris Stratton ... It's looking like I will have to build my own... which 
 is fine.  Part of me wanted to do so anyway since it seems to be the more 
 accepted way to do things.  I was more trying to use the default player b/c 
 I thought it would be the simpler way to do things so I could get the app 
 into the hands of those that are going to be beta testing it.

 For my second issue... Accessing an AsyncTask from a Notification's 
 PendingIntent ... Could I put a BroadcastReceiver in the AsyncTask then 
 send a broadcast on user interaction with the dialog?  That was the next 
 option I was going to try... I just haven't had time to implement it yet.

 On Wednesday, June 20, 2012 10:44:49 AM UTC-4, Chris Stratton wrote:

 On Jun 20, 10:32 am, Saurav to.saurav.mukher...@gmail.com wrote: 
  Have you tried starting the media player in an activity, and overriding 
 the 
  on Back Button pressed function? Handling all the functions in the 
 Activity 
  Life Cycle? 
  
  I am sure there is a way to keep it running programming it in this 
 manner! 

 Certainly there is if you are free to modify the code of the activity 
 and/or service it uses. 

 The challenge of the question seems to be to get a default application 
 already on the device (which, incidentally, is often customized by 
 vendors) to do this. 

 An alternative might be to build a mini-player service and activity 
 into the app based on parts of the AOSP version of the default music 
 player.



-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

[android-developers] Re: Two things holding up my app. Any suggestions?

2012-06-20 Thread Chris Stratton
On Jun 20, 10:32 am, Saurav to.saurav.mukher...@gmail.com wrote:
 Have you tried starting the media player in an activity, and overriding the
 on Back Button pressed function? Handling all the functions in the Activity
 Life Cycle?

 I am sure there is a way to keep it running programming it in this manner!

Certainly there is if you are free to modify the code of the activity
and/or service it uses.

The challenge of the question seems to be to get a default application
already on the device (which, incidentally, is often customized by
vendors) to do this.

An alternative might be to build a mini-player service and activity
into the app based on parts of the AOSP version of the default music
player.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


[android-developers] Re: Two things holding up my app. Any suggestions?

2012-06-20 Thread Shino
@Sauray ... I did not think of that.  I guess my question would be... since 
after the player is launched they are now actually outside of my app, do I 
even have control over the back button at that point?

@Chris Stratton ... It's looking like I will have to build my own... which 
is fine.  Part of me wanted to do so anyway since it seems to be the more 
accepted way to do things.  I was more trying to use the default player b/c 
I thought it would be the simpler way to do things so I could get the app 
into the hands of those that are going to be beta testing it.

For my second issue... Accessing an AsyncTask from a Notification's 
PendingIntent ... Could I put a BroadcastReceiver in the AsyncTask then 
send a broadcast on user interaction with the dialog?  That was the next 
option I was going to try... I just haven't had time to implement it yet.

On Wednesday, June 20, 2012 10:44:49 AM UTC-4, Chris Stratton wrote:

 On Jun 20, 10:32 am, Saurav to.saurav.mukher...@gmail.com wrote: 
  Have you tried starting the media player in an activity, and overriding 
 the 
  on Back Button pressed function? Handling all the functions in the 
 Activity 
  Life Cycle? 
  
  I am sure there is a way to keep it running programming it in this 
 manner! 

 Certainly there is if you are free to modify the code of the activity 
 and/or service it uses. 

 The challenge of the question seems to be to get a default application 
 already on the device (which, incidentally, is often customized by 
 vendors) to do this. 

 An alternative might be to build a mini-player service and activity 
 into the app based on parts of the AOSP version of the default music 
 player.

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en