MusicPlayer in Android status bar - android

I have an Android app which plays mp3 files. I have programmed its main functions like play/pause forward, backward buttons, manipulating by SeekBar, getting current position and so on. Now I want to make my app to continue playing even I closed my app. And when I close it, I want to appear thing like widget in status bar with basic actions (displaying app icon, track name, play/pause button). And also, I want to SeekBar work properly when I reopen my app. Can anyone help me. I'm beginner in Android Java, so it would be perfect if your answer contains steps. Thanks beforehand

I think this tutorial perfectly match your query
Android custom notification for music player Example

It think you need to read this articles:
1) https://developer.android.com/guide/components/services.html?hl=ru - this articles can help you to play music on background. It's very important component of youar app;
2) If you want to provide a widget - just see this article https://developer.android.com/guide/topics/appwidgets/index.html?hl=ru
3) If you want to show notification in status bar, see - https://developer.android.com/guide/topics/ui/notifiers/notifications.html
Also, you can find many iteresting solutions and lessons here - http://startandroid.ru/ru/uroki/vse-uroki-spiskom/164-urok-99-service-uvedomlenija-notifications.html
https://developer.android.com/training/managing-audio/index.html?hl=ru - an interesting article about music players by Google Android Developers
Best regards,
Skidan Oleg

Related

How to create UI and Controls like Apple Music App in Android?

Video Link
I want to create view and animation like Apple Music App available in iOS. But, I want to do it in Android similar to above video link.
Is it possible to create such views in Android? How can I achieve this? How to proceed in this?
Please share any links and references.
This question is already asked but has no answer.
I want to implement something like Apple's new Music app which is synced with iTunes. Bubbles on the move, according to mood we can select a music, genre etc.
I want this type of gesture with moving bubbles in Android. Can anyone help me out, how to figure out and play with Gestures or Motion Controls of that bubbles anywhere in screen. Also is there any support library if available would be very helpful to implement and move further. The bubbles are to be created randomly by a web service call.
Any suggestion in this will be helpful.
i have used box2d with libGdx to configure the gradle in android studio...
u can refer my project on github which has selectable bubbles in random motion, and u can ask if any doubts...
https://github.com/mohitKejriwal/Bubble-UI-Android

Android identifying what is on the upper part of the android notification bar

Currently I want to make an app but I don't know what this is called , I mean the android term for it, it's definately not a spinner, but more into the notifications.
I want to make an app that I can interact with just like the music bar here that can play music, stop next song , etc.
Can someone help me or tell me what that method is and where can I get some tutorials for it?
It doesn't seem to be an ongoing notification. (It's not being under the Ongoing tag being the clue, otherwise I could be sure that this was the case)
http://developer.android.com/reference/android/app/Notification.Builder.html#setOngoing%28boolean%29
It is probably a custom remote view
http://developer.android.com/reference/android/widget/RemoteViews.html
A quick google search will give you examples.

Android - Control Music Player with Phonegap/SteroidsJS/Cordova

I'm currently using Appgyvers SteroidsJS (which is forks of Phonegap and Cordova), and would like to control the default music player from within the app on my Android (5.0.1). Simple things like play, stop, pause, next, and back.
I can't seem to find any direct way to accomplish this, or even a way to pop in to the Android API from Steroids/Phonegap. Does anyone have a solid method to do so or is it not possible? Thanks!
Nothing simple existed, so in the end I learnt how to write something myself. :)
https://github.com/dustinblackman/cordova-MusicControl/

Android App - mediaplayer always available

this is my first post on stack overflow so hoping you can help.
We are developing an Android App, that requires an audio player to always be available, no matter what activity you are on. Ideally, we want this to be a "pop up" style player that is accessible when you tap the screen or tab an always visible button (e.g. on the action bar). However, the player needs to overlay the activity you are on, and continue playing the audio as you move between activities and (ideally) multi task within your device.
I have looked into various options for this, and wonder if a service is the best way to go. The other option I am considering is a transarent activity. But I am open to suggestions!
Can anyone offer any guidance? Thanks in advance.
I think that service, playing the tracks is the best way to go.
For the player visual interface, you should have one view, which will be included wherever you need it.
When you open this view, you will get the information from the service (what track are you on, where exactly in the track) and initialize with those results.
At least this is my suggestion approach to the task. Good luck!
Have tried considering making it an android widget? It remains on the home screen and user can play music and get back to other tasks.
But not sure if it will meet your overlay criteria(Which I quite didn't understand.. :))
Check out Androids MediaPlayer-Class. This should prevent you with all nessesary playback functions. On how to create your player-controll-interface on Androids Action-Bar, check Googles Tutorial. But note that the ActionBar is available since Android 3.0, not in previous version!

Working in background

Actually, I found lots of answers for my questions but this time I am totally stuck.
My question is very easy. I am building a radio streaming application for .pls streams and when the user press the home button, I want my application to continue working. I think lots of you know ebuddy and Skype or the basic media players. They are putting themselves to notification bar and you can easily reach them from this place. I tried to create a notification for my app, but when I click the icon on the notification bar, I can't reach my app. It directly opens a new version of my app and I can't control the streaming, the initial working app is no longer existing.
You may want to read the descriptions for LaunchMode: http://developer.android.com/guide/topics/manifest/activity-element.html#lmode
You want to launch your Activity as singleInstance
Edit: maybe singleTask would be better.
This is the workflow you want to achieve:
All background work has to be done by a service. Implementing one is quite simple, almost as creating an activity.
There are many examples on how to do it:
http://developer.android.com/reference/android/app/Service.html
http://marakana.com/forums/android/examples/60.html
http://code.google.com/p/openmobster/wiki/AndroidService
You need the actual music playing part - or the part that should continue running in the background - to be a service, and the gui to be an activity. The notification you made should bring your activity gui to the front with a flag_activity_reorder_to_front.

Categories

Resources