MediaPlayer todo's

 Package name : com.todokanai.musicplayer 2024/7/18 Todo General     - PathPicker에서 external memory 선택 기능 추가하기  CustomPlayer   - CustomPlayer의 constructor parameter 중에서 seed,playList,shuffleMode,currentMusic,loop의 initial value를 굳이 받아와야 하는건지 재고할것  SettingsViewModel     - apply() 에서 동일 item이 중복 scan되는 현상  PathPickerViewModel    -  close 한 다음, dialog를 다시 열었을 때, 이전의 currentPath 값이 유지되는 현상  *(1) Fixed     CustomPlayer.kt     - setMusic(music:Music?,context:Context) : playList 전체에서 exception 발생시 getCircularNext의 infinite loop 현상 fix    ->  기존의 setMusic 작업을 setMusicPrimitive()로 분리     -> 새로 생성한 상위 method인 setMusic()에서 getCircularNext의 infinite loop 체크 고찰 : setMusic(music:Music?, context:Context)을 Context.setMusic(music:Music?)으로 Refactor 할까 망설이다가 기각함. ( 엉뚱한 곳에서 호출할 위험성 배제 )  //-------------------------------------------------------- 2024/7/19 Todo  General   ...

Rules ( Flexible )

 라이브러리를 import 할때, 이게 여기에 꼭 있어야 할 이유가 있는지 고민하기   -> 결론이 No일 경우, 다른 클래스에서 해결해야 함 자주 사용하게 될 내용은 일반화(generalization) 해서 작성해두기

Class 내부 function의 parameter 설정시 주의할 점

Class Model ( val p1:A ){   fun test ( p1:A ){   // don't do this        p1.내용....   } } --------------- Class Model ( val p1:A ){   fun test (  )  {         p1.내용.....    } }

Rules ( Absolute )

비동기 Thread에서 StateFlow/LiveData 등의 value를 가져오지 않기 
 MVVM 설계 기준) View가 아닌 부분의 메소드들을 강제로 suspend function화 해서, UI thread에 가해지는 부담을 최소화 하는 방법 고려

Android의 Context는 뭐하는 녀석일까...? (작성중)

 String, Int, Activity, Flow .... 얘들은 어떤 놈인지 직관적으로 상상이 된다. 근데 Context <- 얘는 감이 안잡힘. 코드 짤때 쓰고 있으면서도, 이게 왜,어느 부분에 필요한지 이해가 안된상태. 예를들어 println() 함수가 String 값을 요구하는 것은 직관적으로 납득이 된다.  내용이 비어있든 뭐든 간에 일단 출력할 게 필요하니까. 근데 context는? 일단 안드 공식문서에 적혀있는 내용부터 확인하자. Interface to global information about an application environment. This is an abstract class whose implementation is provided by the Android system. It allows access to application-specific resources and classes, as well as up-calls for application-level operations such as launching activities, broadcasting and receiving intents, etc. (앱을 사람에 비유했을때) 개인정보 (어디서 왔고, 뭐하는 놈이며,이런저런 상황에는 이녀석에게 어떻게 대응해야 할지)에 가까워 보인다. 작성하다 보니까 이해해버렸다.
  Privacy policy General Privacy Policy ("Policy") describes how information obtained from users is collected, used and disclosed. By using MusicPlayer, you agree that your personal information will be handled as described in this Policy. The app has no internet access, so it is not sending anything outside the device whatsoever. Information being collected MusicPlayer does not collect any personal identifiable information. 'READ_EXTERNAL_STORAGE' or 'READ_MEDIA_AUDIO(after sdk 32)' 'FOREGROUND_SERVICE' is for background playing feature. 'POST_NOTIFICATION' is for mediastyle notifications. Changes to the Policy If the Policy changes, the modification date below will be updated. The Policy may change from time to time, so please be sure to check back periodically. Last modified: 20 December, 2023. Contact If you have any questions about the Policy, please contact me via bh951201@naver.com