How can I add a soundtrack in multi-windows android app? - java

Good time of the day! I needed to add a soundtrack, but the problem is that the application is multi-windowed. I looked at the documentation, a video on how to add music, but there is a one-window explanation. Can you explain how to make it so that when the button is pressed, the song is played and transferred to another screen, but that the music continues to play, and stops playing when the user presses the button that takes to the 3rd page - stops playing

Related

Android - how to add a [Toggle button] in the Notification Panel ? (the place where you can toggle Wifi, bluetooth, Plane Mode, ect ..)

I'm trying to make my app add a toogle button in the [Notification Panel] the place where you can toggle Wifi, bluetooth, Plane Mode, ect .., (I've spent the last 6 hours searching and I found nothing)
Here's are 2 Examples of what I'm talking about in one picture :
-In the 2 blue frames, those 2 buttons are custom buttons (meaning they have nothing to do with stock android, they've been added by apps from the Playstore),
#1 button : The Shazam button is a shortcut to open shazam (that's not what I need, although would love to know how it's done)
#2 button : First press it starts recording a video on my rear camera (the button becomes activated (blue)), second press it stops recording and saves the video, all this happens in the background, the app that does this never opens (meaning that this is not just a shortcut to the app)
=> So I'm trying to do is to have a custom button for my app, a button like the #2 button, for my app activating/disabling it would make my app's background service send TCP messages to a server, (just in case you want to know what I'm trying to do)
My phone is not Rooted, and I know for a fact that this doesn't require a Rooted phone.
(I'm trying to do this with Xamarin/c#)
sadly no one answered, so i kept searching and i found out that what i called the Notification Panel Menu, was in fact called the "Quick Panel" ..
anyways, here are some links that helped me quite much : Link 1 , Link 2

Android media player stop playing in service

I already asked about it before, but my question even after edits about my progress of fix this noone answered to it anymore. This is original question:
Android media player stop playing while in background
So in short, I'm making music player app, but mediaPlayer stop sometimes when loading next song. After many tests I find out that it stops at mediaPlayer.prepare() and it won't continue as long as I don't trigger any action on phone like turning on display, volume up/down, click headset button. I'm out of ideas what can be a reason of it.
maybe you need to call prepareasync() instead of prepare().

How to set play to a JButton one sound at a time in java?

I have been working on a project for few weeks now. This is the Main Basic UI for the Application
When User Press a button A relevant .wav file is playing but it wont't stop playing when user click another button. i want it to be stopped when user click another button.
You will have to make the current play to stop before another click ,i.e a play request comes in.
public void playClip(String clipName){
if(audioPlayer.isPlaying()){
audioPlayer.stop();
}else{
audioPlayer.setClip(clipName);
audioPlayer.play();
}// not actual code, but you get the idea

Android - Bluetooth Buttons... Media Button Intents or Bluetooth Headset API?

edit
It think all this stuff is now well out of date, there have been many changes to this as android has developed. I'll post an answer when I have worked it out (if noone else has).
I really just want a background app to get first crack at bluetooth messages.
end of edit
I have an android app that needs input from the user - I want to use bluetooth headset buttons (actually bluetooth watch/band buttons - but technically the same!).
I have been looking at media button examples, there are many here and elsewhere which all basically say:-
1) Put receiver/intent in manifest
2) Register receiver in main activity
3) Do processing in the receiver class
This isn't working for me (even cutting and pasting sample code), with no errors, but no events being triggered.
However I also found this:
http://developer.android.com/reference/android/bluetooth/BluetoothHeadset.html
Which is a dedicated bluetooth headset api... has it superceded the media button approach? or is it just higher in the food chain? Should this be used instead of the Media Button Event stuff - or are they just different perspectives?
If the media button stuff is the way, I can post my non-working code, but don't want to waste anyones time if its an out of date approach!
Thanks!
For examples of using bluetooth buttons - this is an excellent example...
https://code.google.com/p/media-button-router/
It detects a hit on the headset 'play' button then pops a dialog asking which app to direct the 'play' to - it plays the choices via the headset so one can be selected without viewing the screen.

Intro Screens with Indicator Dots - Displays only first time - Android

Admittedly, I am Android newbie dev. I would like to know the best approach/solution to showing intro screens for an app, and ONLY at first time use. Similar to Google Drive and several other apps that show the intro screens when you open first time. It has dots at the button to show the screen number you are in. You can swipe to left or right. After you swipe of the last screen, you will enter into the app home screen.
Link to any examples that have screenshots would be good as well.
You launch into the intro screen activity. The first thing it does is check a shared preference. If it exists, you skip the intro and launch the main activity. If it doesn't, you display the first intro screen. When you detect a swipe you switch to the proper new fragment. If its the last screen, you launch the main activity.

Categories