1 / 29

Toast

Toast. 임시적인 알림을 전달하는 작은 팝업창 - static Toast makeText (Context context , int resId , int duration) - static Toast makeText (Context context , CharSequence text, int duration ) 토스트의 속성 - void setGravity ( int gravity, int xOffset , int yOffset )

tobit
Télécharger la présentation

Toast

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Toast • 임시적인 알림을 전달하는 작은 팝업창 - static Toast makeText(Context context, intresId, int duration) - static Toast makeText(Context context, CharSequence text, int duration) • 토스트의 속성 - void setGravity(int gravity, intxOffset, intyOffset) - void setMargin(float horizontalMargin, float verticalMargin) - void setText(CharSequence s) - void setDuration(int duration) - void setView(View view) • 토스트 보이기 - void show() - void cancel()

  2. ToastTest실습 • ToastTest (1 / 4)

  3. ToastTest실습 • ToastTest(2 / 4)

  4. ToastTest실습 • ToastTest(3 / 4)

  5. ToastTest실습 • ToastTest(4 / 4)

  6. ToastTest실습 • 실행결과

  7. Notification • 사용자에게 특정 사건이 발생했음을 알리는 메세지 • 화면 상단 상태바에 아이콘과 함께 내용 출력 가능

  8. NotificationTest실습 • NotificationTest (1 / 6)

  9. NotificationTest실습 • NotificationTest (2 / 6)

  10. NotificationTest실습 • NotificationTest (3 / 6)

  11. NotificationTest실습 • NotificationTest (4 / 6)

  12. NotificationTest실습 • NotificationTest (5 / 6)

  13. NotificationTest실습 • NotificationTest (6 / 6)

  14. NotificationTest실습 • 실행결과

  15. Dialog • 보통 팝업이라고 부르는 화면 중앙에 나타나는 작은 대화창 - 자바스크립트의 alert, confirm 과 유사 • 다이얼로그가 사라질때까지 다른 작업은 불가

  16. DialogTest실습 • DialogTest (1 / 3)

  17. DialogTest실습 • DialogTest (2 / 3)

  18. DialogTest실습 • DialogTest (3 / 3)

  19. DialogTest실습 • 실행결과

  20. Beep • 간단하게 비프음 출력만을 위해서는 SoundPool이라는 클래스를 사용할 수도 있지만 연속으로 클릭 시 다운되는 문제 때문에 MediaPlayer사용 • wav, mp3, ogg포맷 지원 • 음원파일은 프로젝트의 res / raw 폴더에 저장 • 기본적으로 raw 폴더가 생성되어 있지 않으므로 따로 생성 후 파일 복사

  21. BeepTest실습 • BeepTest (1 / 2)

  22. BeepTest실습 • BeepTest (2 / 2)

  23. BeepTest실습 • 실행결과

  24. Vibrate • 촉각으로 알림을 출력한다. • 시스템이 제공하는 서비스이므로 언제든지 구할 수 있다. - Object Activity.getSystemService (String name) • 진동 메서드 - void vibrate (long milliseconds) - void vibrate (long[] pattern, int repeat) - void cancel () • AndroidManifest.xml 에 아래 퍼미션추가 <uses-permission android:name="android.permission.VIBRATE"/>

  25. ※ 퍼미션 • 특정 기능을 사용하겠다는 선언. • 고급 기능은 퍼미션을 선언하여 허가를 받아야 한다. • 퍼미션이없을 경우 기능이 무시되거나 예외가 발생한다. • 특정 기능을 몰래 수행하는 것을 방지하며 설치시에 체크한다. • 실행중에점검하지는 않으므로 허술하다. • 특정 기능이 동작하지 않을 때 퍼미션을 우선적으로 점검해 본다.

  26. VibrateTest실습 • VibrateTest (1 / 3)

  27. VibrateTest실습 • VibrateTest (2 / 3)

  28. VibrateTest실습 • VibrateTest (3 / 3) // 1초 멈춤, 1초 진동 // 패턴 무한반복

  29. VibrateTest실습 • 실행결과

More Related