goldy1992 / mp3player Goto Github PK
View Code? Open in Web Editor NEWAn open source Android MP3 Player
License: GNU General Public License v3.0
An open source Android MP3 Player
License: GNU General Public License v3.0
Change the content resolver to allow the fetching of album art as part of the metadata
Add:
link from material design
When: Search icon is pressed in the MainActivity
Expected: a text box is added. When a character is
the recyclerview is filtered with songs that match the criteria specified in the box
Possible functionality: when there is text present in the search box, a clear button (not specified yet) could be displayed, and when pressed would clear the filter and the RecyclerView would display all items.
Version 2
https://developer.android.com/guide/topics/search/search-dialog
Refer to the android documentation on how to set up a search dialog and connect it to the MainActivity
Create a readme file
Write an automation script for linux and windows that will:
Alongside this there should be a MockRetriever used to select those files from a specific directory on the emulator and use them for testing.
Use this issue to refactor code on the develop branch
Tidy up the dagger code by
Instead of trying to parse every file on disk space:-
Try to use androids MEDIASTORE.AUDIO to get all audio tracks and parse them
WHEN: player is started
THEN: Notification is not displayed (i.e. playerNotificationManager.setPlayer(null)
on startup)
WHEN: a song if played or resumed:
THEN: if notification is not displayed, display it, (i.e. playerNotificationManager.setPlayer(player)
)
WHEN: media player is playing
THEN: notification is active and cannot be removed
WHEN: media player is paused
THEN: notification can be removed
WHEN: back is pressed on the MainActivity and the app is exited
AND: the player is in ANY state
AND: The notification is present
THEN: The notification is NOT removed
WHEN: The media player is playing and the app is removed from the current tasks
THEN: The notification is NOT removed
WHEN: The media player is paused and the app is removed from the current tasks
THEN: The notification is removed
Issue 1
GIVEN: The use has headphones connected and the song is playing.
WHEN: the use removes the headphones
THEN: the state of the media player changes to paused
Issue 2
GIVEN: the user is on the MainActivity
WHEN: the user presses the volume key
THEN: the system does not register a change on volume
Change package structure from
com.example.mike.mp3player
to
com.github.goldy1992
Given the song title: "cuando suena el río" with accent í
When searching using query "rio"
Then the song should be found
SOLUTION
Create a search database that will take items and store them by their normalised searched criteria along with the id.
i.e.
id | title |
---|---|
songs53453 | cuando suena el rio |
where the original string would be database |
StartupProcessor, which is an AsyncTask is referring to the SplashScreenActivity. If the SplashScreenActivity finishes before the AsyncTask has finished, a memory leak could happen as the GC won't clear the references to the SplashScreenActivity in the AsyncTask.
Resolution, make the startup processor a static inner class.
When the shuffle icon:
baseline-shuffle-black-18.zip
is pressed on the MediaPlayerActivity,
THEN: the next song to be played will be randomly selected from the current playlist.
WHEN: the icon is deselected the next item is reset to be the next item in the list that is currently playing
https://material.io/develop/android/components/app-bar-layout/
Apply the Material Design specification to the Main Activity.
Example 1: When the user is at the top of the screen, you can see the action bar that includes the Page Adapter Strip
Example2: when the user is scrolling, you can still see the page adapter strip but the top action bar collapses
Migrate source code to kotlin.
Use the code from other media players as a reference to un-comment the code and register a noisy receiver,
compatible with all versions of android made for the player
Make use of the title bar in order to add Metadata information instead of displaying the app title, and refactor the layout
link from material design
to the media player activity.
When: button is active
Expected: on onCompletion the current track is repeated from the beginning
If able to eliminate all dependencies then me can remove dependencies from build.gradle file
Profile the running of the app using the android studio profilers to find possible bottle necks at runtime.
e.g. One such issue maybe on the skipping of tracks.
Enhance MediaLibrary to organise songs into the directories that they lie on on disk.
Convert all support library methods and compat methods to androidx
STOP
The Ui should wait for all relevant data to be loaded before displaying any information on screen
Get travis to autmatically do builds and post result on the readme file
Make Splash Screen appear in the MainActivity on startup so that the MediaPlaybackService and media items can be loaded concurrently
02-16 22:49:18.751 1604-1618/system_process E/ActivityManager: ANR in com.example.mike.mp3player PID: 7400 Reason: Broadcast of Intent { act=android.intent.action.MEDIA_BUTTON flg=0x10000010 cmp=com.example.mike.mp3player/androidx.media.session.MediaButtonReceiver bnds=[444,312][580,408] (has extras) } Load: 0.56 / 0.28 / 0.14 CPU usage from 692479ms to 0ms ago: 3.8% 1246/surfaceflinger: 0.2% user + 3.5% kernel / faults: 4 minor 1.1% 1329/mediaserver: 0% user + 1% kernel / faults: 8796 minor 2.1% 1604/system_server: 0.5% user + 1.5% kernel / faults: 10321 minor 0.1% 1713/com.android.systemui: 0% user + 0.1% kernel / faults: 1679 minor 1 major 0.1% 1973/com.android.phone: 0% user + 0.1% kernel / faults: 262 minor 0% 2379/com.google.android.gms: 0% user + 0% kernel / faults: 6634 minor 0% 1281/adbd: 0% user + 0% kernel / faults: 4137 minor 0% 1983/com.android.launcher3: 0% user + 0% kernel / faults: 1745 minor 0% 8/rcu_preempt: 0% user + 0% kernel 0% 7164/kworker/1:1: 0% user + 0% kernel 0% 1958/com.google.android.gms.persistent: 0% user + 0% kernel / faults: 2534 minor 0% 1222/logd: 0% user + 0% kernel / faults: 8 minor 0% 3/ksoftirqd/0: 0% user + 0% kernel 0% 1693/sdcard: 0% user + 0% kernel 0% 7165/kworker/0:1: 0% user + 0% kernel 0% 2076/com.google.android.googlequicksearchbox:search: 0% user + 0% kernel / faults: 1412 minor 0% 1215/kworker/0:1H: 0% user + 0% kernel 0% 1241/healthd: 0% user + 0% kernel 0% 1336/fingerprintd: 0% user + 0% kernel 0% 12/ksoftirqd/1: 0% user + 0% kernel 0% 1327/rild: 0% user + 0% kernel 0% 1321/jbd2/dm-0-8: 0% user + 0% kernel 0% 1242/lmkd: 0% user + 0% kernel 0% 1244/servicemanager: 0% user + 0% kernel 0% 1332/zygote: 0% user + 0% kernel / faults: 4964 minor 0% 3400/com.android.defcontainer: 0% user + 0% kernel / faults: 650 minor 0% 1//init: 0% user + 0% kernel 0% 6/kworker/u4:0: 0% user + 0% kernel 0% 7/migration/0: 0% user + 0% kernel 0% 16/kworker/u4:1: 0% user + 0% kernel 0% 2037/android.process.acore: 0% user + 0% kernel / faults: 7 minor +0% 7198/kworker/0:2: 0% user + 0% kernel +0% 7300/logcat: 0% user + 0% kernel +0% 7349/kworker/1:2: 0% user + 0% kernel +0% 7373/com.android.keychain: 0% user + 0% kernel +0% 7400/com.example.mike.mp3player: 0% user + 0% kernel 3.9% TOTAL: 0.8% user + 2.9% kernel + 0% iowait + 0% softirq CPU usage from 2185ms to 2700ms later: 3.8% 1604/system_server: 3.8% user + 0% kernel 5.7% 1618/ActivityManager: 5.7% user + 0% kernel 1.9% 1619/android.ui: 0% user + 1.9% kernel 1.9% 1645/SensorService: 0% user + 1.9% kernel 1.6% 12/ksoftirqd/1: 0% user + 1.6% kernel 1.6% 1246/surfaceflinger: 0% user + 1.6% kernel 3.3% 1296/surfaceflinger: 0% user + 3.3% kernel 2% TOTAL: 1% user + 1% kernel
Investigate this error on emulators that cause an error when pressing the play/pause button
Remove boiler plate coded constructors in
MediaSessionCallback
MediaPlaybackService
MediaPlayerAdapter
by removing the creation code within the constructor and replacing them with @Inject annotations
Mp3Player\app\src\main\java\com\example\mike\mp3player\dagger\components\MediaActivityCompatComponent.java:39: warning: [Dagger/DuplicateBindings] com.example.mike.mp3player.client.views.adapters.SearchResultAdapter is bound multiple times:
public interface MediaActivityCompatComponent {
^
@Inject com.example.mike.mp3player.client.views.adapters.SearchResultAdapter(com.example.mike.mp3player.client.AlbumArtPainter) [com.example.mike.mp3player.dagger.components.MediaActivityCompatComponent]
@Provides com.example.mike.mp3player.client.views.adapters.SearchResultAdapter com.example.mike.mp3player.dagger.modules.SearchResultAdapterModule.provideSearchResultAdapter(com.example.mike.mp3player.client.AlbumArtPainter) [com.example.mike.mp3player.dagger.components.MediaActivityCompatComponent ? com.example.mike.mp3player.dagger.components.SearchResultActivitySubComponent]
This condition was never validated before, and will soon be an error. See https://dagger.dev/conflicting-inject.
com.example.mike.mp3player.client.views.adapters.SearchResultAdapter is injected at
com.example.mike.mp3player.client.activities.SearchResultActivity.setSearchResultAdapter(searchResultAdapter)
com.example.mike.mp3player.client.activities.SearchResultActivityInjector is injected at
com.example.mike.mp3player.dagger.components.SearchResultActivitySubComponent.inject(com.example.mike.mp3player.client.activities.SearchResultActivityInjector) [com.example.mike.mp3player.dagger.components.MediaActivityCompatComponent ? com.example.mike.mp3player.dagger.components.SearchResultActivitySubComponent]
public interface MediaActivityCompatComponent {
^
@Inject com.example.mike.mp3player.client.views.buttons.RepeatOneRepeatAllButton(android.content.Context, com.example.mike.mp3player.client.MediaControllerAdapter, @Named("main") android.os.Handler) [com.example.mike.mp3player.dagger.components.MediaActivityCompatComponent]
@Provides com.example.mike.mp3player.client.views.buttons.RepeatOneRepeatAllButton com.example.mike.mp3player.dagger.modules.PlaybackButtonsModule.repeatOneRepeatAllButton(android.content.Context, com.example.mike.mp3player.client.MediaControllerAdapter, @Named("main") android.os.Handler) [com.example.mike.mp3player.dagger.components.MediaActivityCompatComponent ? com.example.mike.mp3player.dagger.components.fragments.PlaybackButtonsSubComponent]
This condition was never validated before, and will soon be an error. See https://dagger.dev/conflicting-inject.
com.example.mike.mp3player.client.views.buttons.RepeatOneRepeatAllButton is injected at
com.example.mike.mp3player.client.views.fragments.MediaControlsFragment.setRepeatOneRepeatAllButton(repeatOneRepeatAllButton)
com.example.mike.mp3player.client.views.fragments.MediaControlsFragment is injected at
com.example.mike.mp3player.dagger.components.fragments.PlaybackButtonsSubComponent.inject(com.example.mike.mp3player.client.views.fragments.MediaControlsFragment) [com.example.mike.mp3player.dagger.components.MediaActivityCompatComponent ? com.example.mike.mp3player.dagger.components.fragments.PlaybackButtonsSubComponent]
Mp3Player\app\src\main\java\com\example\mike\mp3player\dagger\components\MediaActivityCompatComponent.java:39: warning: [Dagger/DuplicateBindings] com.example.mike.mp3player.client.views.buttons.ShuffleButton is bound multiple times:
public interface MediaActivityCompatComponent {
^
@Inject com.example.mike.mp3player.client.views.buttons.ShuffleButton(android.content.Context, com.example.mike.mp3player.client.MediaControllerAdapter, @Named("main") android.os.Handler) [com.example.mike.mp3player.dagger.components.MediaActivityCompatComponent]
@Provides com.example.mike.mp3player.client.views.buttons.ShuffleButton com.example.mike.mp3player.dagger.modules.PlaybackButtonsModule.shuffleButton(android.content.Context, com.example.mike.mp3player.client.MediaControllerAdapter, @Named("main") android.os.Handler) [com.example.mike.mp3player.dagger.components.MediaActivityCompatComponent ? com.example.mike.mp3player.dagger.components.fragments.PlaybackButtonsSubComponent]
This condition was never validated before, and will soon be an error. See https://dagger.dev/conflicting-inject.
com.example.mike.mp3player.client.views.buttons.ShuffleButton is injected at
com.example.mike.mp3player.client.views.fragments.MediaControlsFragment.setShuffleButton(shuffleButton)
com.example.mike.mp3player.client.views.fragments.MediaControlsFragment is injected at
com.example.mike.mp3player.dagger.components.fragments.PlaybackButtonsSubComponent.inject(com.example.mike.mp3player.client.views.fragments.MediaControlsFragment) [com.example.mike.mp3player.dagger.components.MediaActivityCompatComponent ? com.example.mike.mp3player.dagger.components.fragments.PlaybackButtonsSubComponent]
3 warnings
The following warning should be removed at compile time
At the moment the database that stores the normalised song titles and artists is only over updated once, meaning its will eventually be outdated.
Proposed solution
When the MediaPlaybackService is created add a content observer to android's content resolver and trigger a db update when relevant uri metadata is updated.
On the MediaPlayerActivity
WHEN: the user slides to the left: the next track should slide in from the right
WHEN: to user slides to the right, the previous track should slide in from the left
Create a custom app theme that can be applied to all views in the project
and then different styles to eventually have the option to change the colour scheme of the app in the project settings
When re'entering the MediaPlayerActivity, the timer is updated as if it was running during the background, but does not increment when the activity has started.
Being called unexpectedly...
Ideally it should never be called.
Investigate a circumstance when this is called
PROBLEM:
current onPrepare code calls the PlaylistManager
getCurrentItem
method... The current item is not tracked in this class so could cause potential problems
Issue 1
Ensure that folder names are displayed in alphabetical order in the MainActivity
Issue 2
Ensure that the alphabetical ordering algorithm DOES NOT consider the case of characters. I.e. convert all strings to uppercase for the purpose of matching
GIVEN: when the media session is in state playing
WHEN: the theme is changed
EXPECT: the user interface should show the state as playing
ACTUAL: the play pause button default to being in a paused state
When all asks for permissions on the first time opening, it gets stuck on a White screen.
Ensures loading done after permission is accepted
IF the user declines access the external storage:
AND WHEN: the user re-opens the app
2) permission should be asked again
Look into the situation where the MediaBrowserService is updated and and the notification UI , media player activity UI or main activity UI is not updated
Add functionality for use of ExoPlayer and experiment to see how it performs on different devices
Have a Plus and minus button along with a label that shows the current playback speed setting on the Media Player View.
A user should be able to press once or hold each button to increase or decrease the playback speed by 0.05 percent every time.
A cuustom action must be added to the Media Browser service in order to augment the playback speed
Remove unnecessary use of threads and handlers and use the predefined Coroutine Dispatchers for all concurrent operations
Bare in mind that RoboElectric is still not compatible with junit5
When the player is started, there is a delay during the StartupProcessor causing the view to appear while the processor has already started working.
This needs investigating
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.