Android

모던 안드로이드 (오준석의 생존코딩)

  DB를 이용한 데이터 저장 방법 Room LiveData Room 비동기 처리 UI와 로직 분리 ViewModel DataBinding       모던 안드로이드 #1 – DB를 이용한 데이터 저장 방법 Room 모던 안드로이드 #3 LiveData 모던 안드로이드 #5 – Room 비동기 처리 모던 안드로이드 #7 – UI와 로직 분리 ViewModel   https://developer.android.com/training/data-storage/room https://developer.android.com/topic/libraries/architecture/adding-components https://developer.android.com/jetpack/androidx/releases/lifecycle   Room 라이브러리 추가 MainActivity 에서 onCreate() 에서 Room 입력하고 Alt + Enter -> Add Dependency     activity_main.xml   <androidx.constraintlayout.widget.ConstraintLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”.MainActivity”> <EditText android:id=”@+id/todo_edit” android:layout_width=”0dp” android:layout_height=”wrap_content” android:layout_marginStart=”8dp” android:layout_marginEnd=”8dp” android:hint=”할 일” android:inputType=”textPersonName” app:layout_constraintEnd_toStartOf=”@+id/add_button” app:layout_constraintStart_toStartOf=”parent”…

Read More
Android

될 때까지 안드로이드 정리 (오준석의 생존코딩) 4

    32장 채팅 앱 만들기 : 파이어베이스 활용 1 33장 미세먼지 앱 만들기1 – 앱 소개       될 때까지 안드로이드 #34 [32장 채팅 앱 만들기 : 파이어베이스 활용 1]             될 때까지 안드로이드 #42 [33장 미세먼지 앱 만들기1 – 앱 소개]     <uses-permission android:name=”android.permission.ACCESS_FINE_LOCATION” /> <uses-permission android:name=”android.permission.ACCESS_COARSE_LOCATION” />       <application android:name=”.MyApplication”       프로젝트 레벨 classpath “io.realm:realm-gradle-plugin:3.5.0”     앱 레벨 apply plugin: ‘realm-android’ android { compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { implementation ‘com.google.android.material:material:1.2.0’…

Read More
Android

될 때까지 안드로이드 정리 (오준석의 생존코딩) 3

    26장 이벤트 처리 26장 분위기 변신 – Toast 커스텀 27장 툴바 사용하기 28장 리사이클러뷰 30장 생산성을 높이는 라이브러리 – Realm       될 때까지 안드로이드 #29 [26장 이벤트 처리]   <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” android:orientation=”vertical” tools:context=”com.example.eventexam.MainActivity”> <TextView android:id=”@+id/view1″ android:layout_width=”match_parent” android:layout_height=”100dp” android:background=”#ffebee” android:text=”onClick, onLongClick” /> <EditText android:id=”@+id/edit1″ android:layout_width=”match_parent” android:layout_height=”wrap_content” android:hint=”onFocusChanged, onKey” /> <EditText android:id=”@+id/edit2″ android:layout_width=”match_parent” android:layout_height=”wrap_content” android:hint=”onFocusChanged, onKey” /> <TextView android:id=”@+id/event_info_text” android:la       public class MainActivity extends AppCompatActivity { private TextView mView1; private View mView2; private EditText mEdit1; private EditText mEdit2; private TextView mEventInfoTextView; @Override…

Read More
Android

될 때까지 안드로이드 정리 (오준석의 생존코딩) 2

    14장 뷰페이저 좌우로 밀리는 화면 15장 환경에 따라 화면 구성하기 16장 리소스 17장 브로드캐스트 리시버 18장 콘텐트 프로바이더 19장 비동기 처리-1 19장 비동기 처리-2 20장 DB를 이용한 데이터 저장과 공유 22장 네트워크 통신-1 OkHttp 22장 네트워크 통신-2 Gson 23장 서비스, 인텐트 서비스, 포그라운드 서비스, 바인드 서비스 24장 알림과 알람매니저 – 1 24장 알림과 알람매니저 – 2 25장 지도를 이용해보자1 – 구글 지도       될 때까지 안드로이드 #11 [14장 뷰페이저 좌우로 밀리는 화면]   # 메뉴에서 Fragment 3개를 새로 만든다.   MyPagerAdapter.java   public class MyPagerAdapter extends…

Read More
Android

안드로이드 강의 정리 (홍드로이드)

  TextView EditText & Button Intent 화면전환       안드로이드 앱 만들기 #0 (안드로이드 스튜디오 설치 및 환경설정)   구글에서 안드로이도 스튜디오 검색   https://developer.android.com/studio?hl=ko     안드로이드 앱 만들기 #1 (TextView)     안드로이드 앱 만들기 #2 (EditText & Button)     안드로이드 앱 만들기 #3 (Intent 화면전환)   activity_main.xml   <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent”> <EditText android:id=”@+id/et_test” android:layout_width=”200dp” android:layout_height=”wrap_content” /> <Button android:id=”@+id/btn_move” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”이동”/> </LinearLayout>   activity_sub.xml   <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent”> <TextView android:id=”@+id/tv_sub” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:textSize=”30sp” android:text=”서브 액티비티 도착”/> </LinearLayout>     MainActivity.java   public class MainActivity extends…

Read More
Android

될 때까지 안드로이드 정리 (오준석의 생존코딩) 1

  2장 첫 번째 앱 만들기, 3장 뷰와 뷰그룹 5장 레이아웃: 화면에 뷰를 수 놓는 방법 6장 안드로이드는 액티비티로부터 7장 인텐트와 인텐트 필터 8장 UpNavigation과 메뉴 구현하기 9장 웹뷰 웹 페이지 표기하기 10장 화면 제약을 극복하는 방법 – ListView 11장 기기에 데이터 저장하기 SharedPreference 12장 액티비티 생명주기 13장 프래그먼트     될 때까지 안드로이드 #1 [2장 첫 번째 앱 만들기, 3장 뷰와 뷰그룹]   activity_main.xml   <LinearLayout android:layout_width=”match_parent” android:layout_height=”match_parent”> <TextView android:id=”@+id/edit_message” android:layout_width=”0dp” android:layout_height=”wrap_content” android:layout_weight=”1″ android:hint=”@string/edit_message” /> // 나중에 국제화를 위해서 string 값을 리소스로 빼기 // (2가지 방법: values/strings.xml 파일에 직접…

Read More
Android

Check Box

    chk_red.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean b) { } }); chk_blue.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(((CompoundButton) view).isChecked()){ Log.d(TAG, “Checked”); } else { Log.d(TAG, “Un-Checked”); } } }); https://stackoverflow.com/questions/8386832/android-checkbox-listener         <androidx.constraintlayout.widget.ConstraintLayout xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:app=”http://schemas.android.com/apk/res-auto” xmlns:tools=”http://schemas.android.com/tools” android:layout_width=”match_parent” android:layout_height=”match_parent” tools:context=”.CheckboxActivity”> <TextView android:id=”@+id/tv_result” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_marginTop=”32dp” android:text=”결과 텍스트” android:textSize=”36sp” app:layout_constraintLeft_toLeftOf=”parent” app:layout_constraintRight_toRightOf=”parent” app:layout_constraintTop_toBottomOf=”@+id/btn_result” /> <CheckBox android:id=”@+id/chk_red” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_marginTop=”100dp” android:text=”빨강” app:layout_constraintEnd_toEndOf=”parent” app:layout_constraintStart_toStartOf=”parent” app:layout_constraintTop_toTopOf=”parent” /> <CheckBox android:id=”@+id/chk_blue” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”파랑” app:layout_constraintEnd_toEndOf=”parent” app:layout_constraintHorizontal_bias=”0.498″ app:layout_constraintStart_toStartOf=”parent” app:layout_constraintTop_toBottomOf=”@+id/chk_red” /> <CheckBox android:id=”@+id/chk_green” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:text=”초록” app:layout_constraintEnd_toEndOf=”parent” app:layout_constraintHorizontal_bias=”0.498″ app:layout_constraintStart_toStartOf=”parent” app:layout_constraintTop_toBottomOf=”@+id/chk_blue” />…

Read More