Android :: Resume Activity And Play Audio File After Spawned Thread Completes Download?

Jan 13, 2010

I've got an activity that calls a helper class called DownloadManager. DownloadManager spawns a thread that downloads a mp3 to the sdcard. I'm having some trouble finding the best design for resuming the initial activity and starting the MediaPlayer. Does it make the most sense to use a BroadcastReceiver that receives a message that download is complete, then start a new Intent of my activity? Think I saw something that I can't use an Intent to start an Activity from BroadcastReceiver because it is a background process.

Android :: resume activity and play audio file after spawned thread completes download?


Android :: Suspend / Resume Thread From Another Thread In Same App

Feb 20, 2009

I need to suspend/resume a thread from another thread in the same process. I tried to look into thread apis,but I couldn't figured out a way to achieve this.Can anyone pls point me some references to look or give a tip to do this.

View 2 Replies View Related

Android :: Prevent Orientation Change On Keyboard Flip Until Thread Execution Completes

Oct 25, 2009

When I flip the keyboard, the layout changes from portrait to landscape, activity is recreated but any background thread keeps running. How can I prevent orientation change/activity from being recreated until my background thread finishes.

View 2 Replies View Related

Android :: Activity Blocks Till Service Completes

Oct 10, 2009

I am starting a service from an activity. Once the services starts, the calling activity loses focus and blocks till the service is completed. Why is this and is there a way around it to return the control to the calling activity while the service runs in the background?

View 6 Replies View Related

Android :: Set Solid Background To Spawned Activity

Sep 9, 2010

I'm not very familiar with the android SDK yet. I have an application (game), which is developed mainly using the NDK, and uses egl to render. i have an activity which handles the egl swapbuffer and runs the games native main loop, pretty straight forward I guess.

Now I have made another activity which host a TableLayout containing an EditText as well as a button (simply for text-input later used by the game). I spawn this activity from my main activity using startActivityForResult. The small problem I'm having now is that I can't manage to make this "popup" activity to have a background, so my paused game will reside in the background, with the various widgets just overlaid. This is not very pretty in my opinion, and I would like to at least have a solid background color for my spawned activity while it's active. I *could* just simply go into some state in the games main loop which clears the gl-screen just before I spawn the new activity. But I don't like this solution and it's a tad more work then I'm prepared to put in just at this time in the project. I'm pretty sure there is some simple way to just set a background color somehow, I just can't find *any* way to do it, I've looked around in the SDK resources and tried to search for any hints towards this, but i'm just not familiar enough with the java SDK to find what i'm looking for.

On a side note I would also like to be able to center the EditText widget as well as the button on the screen once the Activity is active, I haven't looked very deeply into it yet, but from a quick glance of the documentation I couldn't really find any suitable positioning methods in the tablelayout class. But as I said, haven't looked very hard. Can probably solve that one easy, but i'm just throwing this in as well :)

View 2 Replies View Related

Android :: Play Remote Audio File In Android Audio Player

Nov 12, 2010

I am working on a application that would allow users to play remote files. My question is how do I open those remote files to be played in the default android player?but this does not give me control of what is happening!

View 2 Replies View Related

Android :: Access Original Activity's Views From Spawned Background Service?

Jul 21, 2009

I have an activity called A, and on the selection of menu item 0, it spawns service B, which starts a runnable C in a new thread. I have a TextView in activity A, which I want to access in thread C.

I've tried making the TextView a public static field, but that generates the following error:...........................

View 5 Replies View Related

Android :: Play Audio File From Assets Directory

Jul 20, 2010

when I run this code, it starts playing all the audio files in the assets directory, in alphabetical order instead of just playing the audio file I requested. What am I doing wrong? Is there a better way to play audio files from the assets directory?Is there a difference between keeping audio files in the assets directory and keeping them in the res/raw directory? Besides the fact that they don't get ids if they are in the assets directory. If I move the audio files to the res/raw folder then I have a problem with reusing MediaPlayers because there is no id parameter for setDataSource(). I can't find a good guideline for handling this kind of problem.

View 1 Replies View Related

Android :: Play Audio From Stream / Stored Cache File

Feb 10, 2010

How to play audio from a stream in android? I will get input stream from an online link( like continuous FM). I need to cache the stream and play it. I searched a lot in sites,,,but didnt get.They show option of playing from a stored file. There is no option to play from a stream.

View 2 Replies View Related

General :: Play WhatsApp Audio AAC File?

Apr 6, 2014

i save whatsapp audio files ( .aac ) , but i cant' play them on pc or phone ...

View 2 Replies View Related

HTC Incredible :: Unable To Play This Type Of Audio File

Jun 4, 2010

I have an HTC incredible and have tried everything to put music on it, the most recent program i am using is tunesync, which works great. However, whenever i transfer music i always get the message "unable to play this type of audio file" I have tried everything from making the files all mp3 format to using different programs to do the sync, but nothing will work.

View 3 Replies View Related

General :: Play Audio File On Voice Call

Dec 17, 2011

I want to play an audio file on a voice call as following the application initiates a call from device X to device Y. When Y replies application on device X should inject an audio file in the stream of the call so device Y hears this audio file

Is possible to inject an audio file in the stream of the call/the output of microphone?

View 2 Replies View Related

General :: Can't Play Any Audio File And See Photos In Gallery

Aug 16, 2012

All apps that play audio files from my device can not find and play any of my songs and audio files that are in my device internal SDcard and I can not see my photos in the gallery.

View 4 Replies View Related

Android :: Pause N Resume The Activity?

Jan 20, 2009

How to pause and resume the activity?

View 3 Replies View Related

Android :: Resume Download After App Stop/start Lifecycle

Feb 6, 2010

I've an App which performs a potentially large download in background thread. When the orientation changes or the keyboard is opened the App lifecycle system invokes the start/stop/pause/resume etc calls - is there any strategy available to resume the download rather than just set a flag so the new onCreate() knows it was interrupted and has to start it again?

View 2 Replies View Related

Android :: Launching Correct Activity On Resume

Jan 22, 2010

I'm currently working with a two-activity application. The first activity allows the user to choose options for their upload, and the second activity displays a ListView of their results once processed.I have code in place that performs the uploads/downloads in the background, regardless of whether the application is currently in focus or not (thanks to Matthias Kaeppler's Droid-Fu).I would like to have my application Resume into my second (results) activity when a user clicks on the icon from the top-level launcher, regardless of how long they have been away from the app. I thought that the 'alwaysRetainTaskState' flag in the Manifest would do it, but I've not had success with that. Can anyone tell me how I need to set up my Manifest to get this functionality?

View 19 Replies View Related

Android :: StartActivity -intent - And Resume To Main Activity

Jul 2, 2010

I've got an app that creates an intent for the last.fm android app in which it will start the "recommended" station for my account when i press a button. The trick i'm trying to figure out is how do i get the phone back to my app without the user having to navigate back manually? Once it start the last.fm intent it takes you to the playlist and i need it to resume back to my app automatically.

View 2 Replies View Related

HTC Incredible :: Music Sync - Message Unable To Play This Type Of Audio File

Jun 4, 2010

I have an HTC incredible and have tried everything to put music on it, the most recent program i am using is tunesync, which works great. However, whenever i transfer music i always get the message "unable to play this type of audio file" I have tried everything from making the files all mp3 format to using different programs to do the sync, but nothing will work.

View 1 Replies View Related

Android :: OnPause() - Resume To An Activity Which Has A Bundle Passed To It When Created

Mar 11, 2010

I have an application where I navigate from Activity A to Activity B and back to A and then B. I want to resume the activity B (which has a Bundle passed to it ) from Activity A. The documentation says that OnSaveInstance() is called only when the activity is killed, so how do i use OnPause which does not have the Bundle to resume the activity B.

View 13 Replies View Related

Android :: Pausing VideoView When Launching A New Intent / Resume It To Starts Up Activity Again?

Jul 23, 2009

I have an activity that is showing a video and when the user clicks a button, a new activity is launched. When the video activity stops, I pause the video view. When the video activity starts up again, I try to resume the video view videoView.start(), however, the video starts over from the beginning. I'm thinking that the buffer must be lost somewhere, so I now try to capture the current position via videoView.getCurrentPosition(), however, this is always returning 0.

Anybody know how to resume video playback when an activity starts up again?

View 5 Replies View Related

Android :: Is There Way To Phone And Play Audio File In Android ?

May 5, 2009

I would like to create an ermergency call application : if triggered, it calls a given number and play an audio file, giving the information the caller couldn't give himself.For that I need to engage a call but ensure that I can replace any sound from the speaker with an played audio file. Can I do that in android ? What's the way?

View 1 Replies View Related

Android :: Audio Record And Play Recorded Audio

Jun 2, 2009

Could you please let me know how to do the audio record in android emulator and play the same recorded audio. Could you please help me in proceeding in development.I tried with MediaPlayer API's also.Its not working.

View 5 Replies View Related

Android :: Analog To IOS Core Audio / Audio File Stream Services?

Sep 22, 2010

Is there an Android equivalent to the iOS Core Audio / Audio File Stream Services? I need to be able to read audio bytes from a network and feed them to the audio system under my control, so I can do my own timeouts / reconnects / range requests / etc. without interrupting the audio playback (since the system audio thread would be playing audio already enqueued). It seems that MediaPlayer doesn't give me this level of control. Is there a lower-level framework that does, either in the SDK or NDK?

View 2 Replies View Related

Motorola Droid : How To Play Audio From Phone Through RR Audio System?

May 5, 2010

I connected my phone via USB to my RR sport to upload audio files to the RR hard drive. However, I keep getting connection error. Apparently my device is not being recognized as a storage. I did the unmount thinking. Also, I am wondering how I can play audio from my phone through the RR audio system.
RR is 2010.

View 2 Replies View Related

Android :: Combine Only One Audio File From Two Audio Files

Oct 2, 2010

I want combine two audio files. (A audio file + B audio file = AB audio file)So, my search result is:

1. useing an AudioTrack.

2. decode PCM from audio file.

3. combine PCM.

This is currect? It there another way?

View 1 Replies View Related

HTC Incredible :: Trying To Play Music - Says Unable To Play This Type Of Audio

Apr 28, 2010

I took out the 8GB SD card from my Blackberry Storm and put it the Incredible.

I had a bunch of music saved on my SD Card that I downloaded from VZW Music Media thing.

When I go to music on the Incredible and go over the song (it shows the picture of the album of the song)

it says "unable to play this type of audio"

View 10 Replies View Related

Android :: Unable To Play File When Set Data Source To Sd Card File

Apr 13, 2009

I am trying to play file which is stored in SDCARD in emulator. I have Linux O/S. So i need to provide command in run configuration. I am providing following parameter.

-sdcard /usr/android/sdcard/mysdcard.iso -audio oss [i]

The following is my code to play file.

try { mMediaPlayer.setDataSource("/sdcard/test_cbr.mp3"); mMediaPlayer.prepare(); // Giving error. mMediaPlayer.start(); }

View 4 Replies View Related

Android :: Using Thread In Activity Or In Service?

Jun 12, 2010

In Virgil Dobjanschi's talk, "Developing Android REST client applications" (link here), he said a few things that took me by surprise. Including:
Don't run http queries in threads spawned by your activities. Instead, communicate with a service to do them, and store the information in a ContentProvider.
Use a ContentObserver to be notified of changes.
Always perform long running tasks in a Service, never in your Activity.
Stop your Service when you're done with it.

I understand that he was talking about a REST API, but I'm trying to make it fit with some other ideas I've had for apps. One of APIs I've been using uses long-polling for their chat interface. There is a loop http queries, most of which will time out. This means that, as long as the app hasn't been killed by the OS, or the user hasn't specifically turned off the chat feature, I'll never be done with the Service, and it will stay open forever. This seems less than optimal.

Long question short:
For a chat application that uses long polling to simulate push and immediate response, is it still best practice to use a Service to perform the HTTP queries, and store the information in a ContentProvider?

View 1 Replies View Related

Android :: How Can I Stop A Thread In A Activity?

Dec 9, 2009

My problem is: Activity A called Activity B, and in Activity B, it start a background thread to do some client-server work. But it maybe takes too much time. So i add a cancel button to call the stop() method to stop the thread, and call finish() to finish the Activity B and go back to Activity A. Although it is back to Activity A, the thread isn't stop immediately. Can i just call the finish() to go back to Activity A, and leave the thread to exit by itself? If it is not the right way, which is?

View 10 Replies View Related

Android :: Possible To Send An Event From A Thread To An Activity?

Jan 28, 2010

If I want to send an event, e.g. OnClick, to an activity from a thread? The expected work flow is below:public class HelloAndroid extends Activity {public void onCreate(Bundle savedInstanceState)Code...

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved