Android code - Remember last played song [closed] - android

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Is there a way to get the details of last played song in the android music player.
I am developing a music player.
whenever the my music player application is launched I need to start it with the last played song as in the stock android music player.

Is there a way to get the details of last played song in the android music player.
You are welcome to contact the authors of each "android music player" and ask them if there is an API that you can use for this.
I need to start it with the last played song as in the stock android music player
There is no single "stock android music player". Device manufacturers can ship whatever music player they want, and many ship their own.
Neither the Music AOSP app nor the Play Music app have a documented and supported API for retrieving last-played song information.

before exiting the application , save the path of music file in the database. load the path when application launch.
the code should be inside try catch

save the track or song id into the XML file when your music player closes and fetch it from that XML resource file when the music player starts.

Related

Playing Youtube DASH Url in Exo Player [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
We are building an android app to play youtube videos in exo player. We generate a DASH URL and play it using exo player
I have following concerns
Is it allowed by play store to play youtube URLs without using Youtube player e.g, using Exo player
If it is not allowed, What is the way to get it done? Is it allowed if we use the youtube player?
Is Youtube player build on top exo player?
The short answer is: No.
You can play anything to which you have a direct URL to the media. YouTube don't expose direct URLs, so you'd have to use their player API instead. Of course, you could host DASH content yourself, as you're doing for HLS, which would provide you with the direct URLs you need.

Android record audio for piano application [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Hello everyone tell me please: for me it is very important to me to record sound from audio output stream or other but am need record hardware sound from speakers for my piano application.
How do it work in other applications...
Please help me.
I not sure you want to record piano from your android application or you you want to create a sound bank from a piano and use it in the app, but either way you can use FMOD http://www.fmod.org/download/
It is a very powerful audio library (lots of game engines using it e.g. CryEngine, Unity, ...), it has both abilities of recording and playback and gives you a cross-platform unified API.
However if you only want to create a piano audio bank, I believe using MIDI instruments would be a better idea

How to show YouTube browsing in my android app? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
This is my android app :
My media player can play YouTube videos if we give HTTP URL. So I can launch YouTube app on a button Click. It's working fine.
Requirement:
After user tapping on video, I want to close that YouTube app and get the downloadable URL of that video. How can I do that? Is there any tutorials for that? If this is not possible kindly suggest me possible ways. Thank You.
YouTube Android Player API
The YouTube Android Player API enables you to incorporate video playback functionality into your Android applications. The API defines methods for loading and playing YouTube videos (and playlists) and for customizing and controlling the video playback experience.
This page has a getting started at the end of the page which will help you.

play music infinitely until a button is clicked [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm just trying to play music continuously in an infinite loop until a button is clicked.it works fine but,say for eg: my sound file is 5 sec. after every 5 sec there is a pause and the music plays again.Is there anyway to prevent that and play the music without interruption?
I have used Setlooping(true) for that infinite loop.
Your problem is that your music file likely contains a short pause at the end (or the beginning). You will need to edit this file in a sound editor to make it more suitable for continuous playback.
EDIT
To be clear, are you looking to loop one specific sound file, or any sound file in general?

How to draw waveform of Android's music player? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
one of the default live wallpapers that came with my phone was a wallpaper that displayed the wave form of music playing in the background in real time. I was wondering how one could go about doing this. It seems I should somehow access the streaming data of the background music and compute the samples in real time, but I have no idea how to get the streaming data. I think I can display the wave form by following this tutorial http://codeidol.com/java/swing/Audio/Build-an-Audio-Waveform-Display/, but I'm not exactly sure how to do it. Help would be greatly appreciated/
There is an Android class called Visualizer that lets you access audio being played
http://developer.android.com/reference/android/media/audiofx/Visualizer.html
In addition, since Android is all open source, you can look at how the live wallpaper does it!
https://android.googlesource.com/platform/packages/wallpapers/MusicVisualization/

Categories

Resources