2021.10.31_4.4초보자도10분이면Mp3플레이어만들기
본문 바로가기
안드로이드(Android)

2021.10.31_4.4초보자도10분이면Mp3플레이어만들기

by KyeongMin 2021. 10. 31.
728x90
반응형

버튼 방식

  • 버튼같이 구성 할 수 있는 방식에는
    • <Button/>
    • <ImageButton/>
    • <TextView/>
      • 텍스트 뷰에서 자체적으로 클릭할 수 있게도 가능함

TextView 클릭 방식으로 적용 하기

Before

    <TextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Hello World!"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintLeft_toLeftOf="parent"
      app:layout_constraintRight_toRightOf="parent"
      app:layout_constraintTop_toTopOf="parent" />

After

    <TextView
        android:id="@+id/helloButton"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:text="Play" 
        android:textSize="100dp"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintLeft_toLeftOf="parent"
      app:layout_constraintRight_toRightOf="parent"
      app:layout_constraintTop_toTopOf="parent" />
        android:id="@+id/helloButton"
      android:text="Play" 
        android:textSize="100dp"

mp3파일 추가

  • res 폴더에서 오른쪽 클릭 New -> Android Resource Directory클릭

  • value를 raw로 변경
  • 그렇게 하고 mp3파일을 생성된 raw넣는다.

  • 위와 같은 상태가 되어야함

  • 클릭전 상태

 

  • 클릭 후 노래가 재생 되고 글씨가 바뀌는것이 확인 됨
  • 물론 이게 완벽한 mp3앱은 아니지만 기본적으로 이렇게 되는것
    • 여기서 응용해서 발전하는게 베스트이다.

원본

https://github.com/3DPIT/android/edit/master/03.anroidTest/%EC%89%BD%EA%B2%8C%EB%94%B0%EB%9D%BC%ED%95%A0%EC%88%98%EC%9E%88%EB%8A%94%EC%95%88%EB%93%9C%EB%A1%9C%EC%9D%B4%EB%93%9C%EC%95%B1%EA%B0%9C%EB%B0%9C/1031/04.%EC%95%B1%EA%B0%9C%EB%B0%9C%EC%8B%9C%EC%9E%91/2021.10.31_4.4%EC%B4%88%EB%B3%B4%EC%9E%90%EB%8F%8410%EB%B6%84%EC%9D%B4%EB%A9%B4Mp3%ED%94%8C%EB%A0%88%EC%9D%B4%EC%96%B4%EB%A7%8C%EB%93%A4%EA%B8%B0.md

 

GitHub: Where the world builds software

GitHub is where over 73 million developers shape the future of software, together. Contribute to the open source community, manage your Git repositories, review code like a pro, track bugs and feat...

github.com

 

728x90
반응형

댓글