How to use inbuilt Equalizer by intent - android

I am working in a media player project but for equalizer .I want to call the inbuilt equalizer in my app but How to open an equalizer using intent ,I am able to open gallery but How I can open an equalizer?
I am following these Open gallery app by Intent,Open gallery app

I am able to open the media player equalizer by the following way
Intent intent = new Intent();
intent.setAction("android.media.action.DISPLAY_AUDIO_EFFECT_CONTROL_PANEL");
startActivityForResult(intent, 1);
Hope it will help some one.

Related

Stream music through URL on pre installed music player

I am trying to play a music file located on Internet with some URL like "http://......../music.mp3"
I am using the following code
Uri myUri = Uri.parse("http://..../music.mp3");
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(myUri, "audio/*");
startActivity(intent);
this code is not playing music in any installed music player, I think it passes the URL so music player is unable to play it.
I dont want to play music on my app. can anyone give me a hint how to implement it.

How to start inbuilt voice recorder application?

I have to attach voice recorded file as attachment to my android application. I have created a separate activity for voice recording without using inbuilt voice recorder application and it's working fine.
I thought of using the inbuilt application 'Voice Recorder' instead of using the activity which I have created.
I know that using Intent we should start the new activity. But I'm not able to find out how to start inbuilt voice recorder application and how it should be opened from my application?
Kindly let me know if anyone has experience in handling this scenario.
Thanks in advance!
You can try this
public static final int ACTIVITY_RECORD_SOUND = 0;
Intent intent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
startActivityForResult(intent, ACTIVITY_RECORD_SOUND);

Android - how to open an audio-stream url with an external app?

I want to give the user the choice of opening an audio stream url with an audio player that he already have installed.
The following code works as so far that the user getting a list of installed audio apps and can choose between then.
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(stream.getAudio()), "audio/*");
startActivity(intent);
But it will open an intent that lives inside my app only. Therefor the playback will stop if the user closes my app. How can I change the behaviour so that not an new activity is started but the whole app is launched and is detached from my app.
I guess it's because the audio player is opened in the same task stack of your app.
Try Intent.FLAG_ACTIVITY_NEW_TASK to start it as a new task, like:
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
See Tasks and Back Stack to learn more.

How to access the default MediaPlayer

I have a link to a audio file. I don't want to create a object using my code for a Mediaplayer and play it, but instead I want to call the inbuilt MediaPlayer app of my android mobile. Is this possible at all. Any help is much appreciated.
Try this:
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(audioFileUri, "audio/*");
startActivity(intent);
Or change the last line to startActivity(Intent.createChooser(intent, "play music")); to display a app chooser to finish the task.
I have used this piece of code and find that it doesn't work for the audio files for /raw folder. I guess this happens because the player can't get access to the resource from developer's package.

Playing audio files in android

I need to play long audio files using the Android SDK. I am aware of the MediaPlayer framework shipped by Android, but I was wondering wether the built-in "Music Player" application could be invoked, so I don't have to write my own player GUI and code.
Yes, you can.
Set up an intent like this:
act=android.intent.action.VIEW dat=file:///mnt/sdcard/song_name.mp3 typ=audio/mpeg3
Action: VIEW
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri
.parse("file:///mnt/sdcard/song_name.mp3"),
"audio/mpeg3");
startActivity(intent);

Categories

Resources