study & bootcamp/안드로이드 앱 스터디

notification을 통해 휴대폰 알림을 만들 수 있다. (1) activity_main.xml 액티비티에 버튼을 한 개 생성하여 버튼을 클릭하면 알림이 뜨도록 만들어 볼 것이다. (2) MainActivity.java package com.example.notificationexample; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.NotificationBuilderWithBuilderAccessor; import androidx.core.app.NotificationCompat; import android.app.Notification; import android.app.NotificationManager; ..
dialog를 이용하여 특정 동작을 통해 액티비티 내부에 팝업창을 띄울 수 있다. https://www.youtube.com/watch?v=SmsshpB1O38&list=PLC51MBz7PMyyyR2l4gGBMFMMUfYmBkZxm&index=17 (1) activity_main.xml 버튼을 눌러 다이얼로그 팝업창을 띄우고 팝업창 내에서 내용을 입력하면 textview 내용이 바뀌도록 설계할 것이다. (2) MainActivity.java package com.example.dialogexample; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import android.content..
thread는 동시작업을 하기 위해 필요한 작업단위이다. 참고로 외부스레드를 사용하지 않은 상태는 메인스레드 상태다. thread를 사용하는 이유는 여러 동작을 함께 할 때 꼭 필요하기때문이다. 대표적인 예로는 타이머가 있다. 타이머를 작동시키며 백그라운드 상태에서 다른 일을 할 수 있는건 바로 thread 덕분이다. 그러나 thread를 구현하는데 있어서 주의할 점이 있다. xml 부분에서 thread 여러개가 동시에 접근할 수 없다. 그렇기에 기본적인 메인스레드만 xml부분은 UI에 접근할 수 있고 다른 스레드들은 handler와 같은 별도의 제어롤 통해 다뤄야 한다. https://www.youtube.com/watch?v=aYjdfpit6lc&list=PLC51MBz7PMyyyR2l4gGBMFMM..
이번 강의에서는 ListView의 업그레이드 버전이자 많은 수의 데이터 집합을, 제한된 영역 내에서 유연하게(flexible) 표시할 수 있도록 만들어주는 위젯인 RecyclerView을 구현하는 법을 알아볼 것이다. https://www.youtube.com/watch?v=kNq9w1_nhL4&list=PLC51MBz7PMyyyR2l4gGBMFMMUfYmBkZxm&index=13 (1) activity_main.xml // scrollbarFadeDuration : 스크롤을 안해도 안사라짐 // scrollbarTumbVertical : 스크롤바 색상 꾸미기 // layout_weight : 이 layout에 orientation 방향에 따라 고정비율을 줌 (0에 가까울수록 높은 비율 차지) ● rec..
이번 강의에서는 메모를 남기는 주석 다는 부분과 오류 디버깅을 할 때 주로 사용하는 Log출력하는 법에 대해 알아볼 것이다. https://www.youtube.com/watch?v=gmZaayoaY3I&list=PLC51MBz7PMyyyR2l4gGBMFMMUfYmBkZxm&index=15 (1) Log 출력 Log.e(String tag, String msg), Log.v( ... ) 등으로 log 출력 가능. (2) java 주석 //로 주석 처리한다. /* */로 사이 것들을 주석처리한다.
이번 강의에서는 한 Activity에서 Fragment라는 조각의 뷰만 교체하는 방식을 구현하는 법을 알아볼 거다. 카톡같은 곳에서 친구, 채팅 등과 같은 것이 바로 Fragment를 사용한 부분이다. https://www.youtube.com/watch?v=3Th96mVEpyo&list=PLC51MBz7PMyyyR2l4gGBMFMMUfYmBkZxm&index=14 (1) activity_main.xml ● Framelayout을 통해 activity_main에서 Fragment를 띄울 수 있다. +) Framelayout 자식(Children)으로 추가된 여러 뷰(View) 위젯들 중 하나를 Layout의 전면에 표시할 때 사용하는 클래스이다. 참고 : https://recipes4dev.tistory..
직접 Navigation Menu 부분을 구현해볼 것이다. (1) activity_main.xml /// 액티비티 drawerlayout을 이곳에 포함시켜라(연결) (2) activity_drawer.xml (3) MainActivity.java package com.example.customnaviexample; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.drawerlayout.widget.DrawerLayout; import android.os.Bundle; import android.view.MotionEvent; import android.view.View; i..
자신이 원하는 인터넷 주소의 내용을 띄울 수 있는 WebView를 넣는 법을 알아보았다. (1) activity_main.xml WebView를 추가해준다. (2) MainActivity.java package com.example.webviewexample; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.KeyEvent; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.webkit.WebViewClient; public class MainActivity extends AppCom..
앱을 재실행했을 때 앱이 삭제되지 않는 한 남아있는 데이터값들을 ShraredPreferences를 통해 구현한다. (text뿐만 아니라 스위치와 같은 것들도 SharedPreferences로 저장가능) (1) activity_main.xml EditText 한 개를 만들어줌 (2) MainActivity.java package com.example.firstapp; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.content.SharedPreferences; import android.os.Bundle; import android.view.View; import android.wi..
내용출처 : 유튜브 홍드로이드님 강의 -to do list- 1. TextView 2. EditText & Button 3. Intent 화면전환 4. ImageView & Toast 5. 패키지구조 & 역할 6. ListView 7. Navigation Menu +) 앱 launching방법은 맨 위에 실행 키 누르고 맨 아래에 있는 4: Run키 누르는 것이다. 1. TextView (activity_main.xml 부분을 조작하여 design부분에 TextView 넣기) ① 원래 ConstraintLayout으로 기본설정되어있었는데 LinearLayout으로 바꿔줬다.(단지 그게 더 편해서) ② html만들듯이 를 통해 TextView를 간단히 넣을 수 있다. ③ android:layout_widt..
태윤이
'study & bootcamp/안드로이드 앱 스터디' 카테고리의 글 목록 (2 Page)