Hi everyone I recently made an application that is actually a media player of a football club ultras music. I tested it on my phone (Motorola X running Android 4.4.4) when i go back to the dashboard the music keeps playing and everything is OK. But I had a review that on Samsung Trend Plus running Android 4.2.2 the music stops playing when going back to dashboard. I didn't know what may cause this issue? any ideas? Thanx
Most likely your problem is with audio focus. On certain system, when user go to the dashboard, the launcher might take audio focus (and pause your audio play) to play its launch sound (the clicking noise or w/e). Right after that, it should hand back audio focus to you and you will need to resume your playing.
http://developer.android.com/training/managing-audio/audio-focus.html
Related
I am trying to disable screen record and screenshot in my flutter app and I already did using flutter_windowmanager package.
my problem is with screen recording, the sound of the video inside th app is still running and recorded by screen recording !
any suggestions for also preventing sound record ?
No. If your app is playing loud enough the microphone can hear it, it can be recorded. There's no way to prevent that- algorithmically canceling out sound from one source in an audio recording like that would be difficult, if not impossible. Nor would it really buy you all that much- they could always just hold an external mic up to the phone (they can also just capture your app with a second camera, which makes removing video recording also of limited use, if done to prevent a user from recording).
The one thing you could do is claim the mic yourself and not give it up. But that would be annoying to anyone actually using your app. And wouldn't rpevent capture with an external device of course.
I wonder if this happened to anyone else so far. I am developing an app that is sending Bluetooth strings to Arduino while playing VR video. I am using Note 4 for testing and Android Studio for development.
The video and bluetooth works just fine until i put in the 4k video. It starts playing it and if not in "cardboard mode" it works. But as soon as we go to "cardboard mode", the video freezes. The voice continues to play in the background and if i go out of "cardboard mode" it continues the playback.
Any ideas to why this is happening? I have implemented VR video View just as Google suggests (from their test code). Monitor shows no errors, nothing. When i check the GPU monitor i just some really bad spikes when entering "cardboard mode", but then it just stops.
How can I stop other apps that are playing background music when my app opens? I have an app that plays music and videos, but if a background app was already playing music it keeps playing.
On Fire TV I also have a problem that the background music app such as I heart Radio intercepts the play and forward buttons from the remote, so in my app if I try to skip forward it just switches I heart Radio to a new station and makes it start playing even if IhR had playback stopped.
The Netflix and Hulu apps both have solved it, so I know there has to be some way to do it, but my searching only turns up stuff on how to kill your own background service that is playing music, not any background music service.
I am trying to stick to API 8 for the greatest compatibility, but if I have to go up to a higher API I'd like to go no higher than 14 (ICS).
Per the FireTV documentation you need to manage Audio Focus via the requestAudioFocus call (added, as you need, in API8)
My app plays an audio file. I want my app to pause the audio playing if another apps starts to play audio. I don't want the two audio sounds mess up each other. My app will resume the audio playing after the other app finishes playing its audio. How can I make it? Thanks.
Depending on how your application is running ie. while app is running in foreground (users is looking at your screen) or if your running a "service" which is currently in the background and you wish music to continue playing (songza, slacker radio etc.) how you handle these things will be different. Android uses internal system states to determine which apps should be out-putting audio to the speaker. All this is handled by the audio manager requestAudioFocus() releaseAudioFocus() will be the system calls you will want to look at the most. For a more detailed explanation see android developer api where you this is explained and documented quite well http://developer.android.com/guide/topics/media/mediaplayer.html
I'm streaming HLS, and after 10 minutes or so, the video hangs but the audio stays on. I can then not click anything other than holding the home button to get the task manager to force close the app. Anyone know how to fix this?