본문 바로가기
반응형

Android10

[Android Studio] Connect Device With Wi-fi 와이파이로 안드로이드 기기 연결하기 1. in terminal cd AndroidSDKLocation/platform-tools ex) cd /Users/sanghyun/Library/Android/sdk/platform-tools 2. USB로 단말기기 연결하기 3. adb devices 4. 네트워크 모드로 변경 adb tcpip 5555 5. 설정 - 연결 - Wi-Fi - 현재 네트워크 설정 에 들어가서 ip주소 알아내기. 6. 단말기 연결 끝 USB 연결 해제하고 무선으로 사용~ 2021. 10. 3.
View Binding 뷰 결합 대부분의 경우 뷰 결합이 findViewById를 대체합니다. 뷰 결합은 모듈별로 사용 설정됩니다. 모듈에서 뷰 결합을 사용 설정하려면 다음 예와 같이 viewBinding 요소를 build.gradle 파일에 복사합니다. build.gradle (:app) android { ... viewBinding { enabled = true } } MainActivity.kt (activity_main.xml) import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import com.s_archive.paypal2us.databinding.ActivityMainBinding class MainActivity : AppCompatActi.. 2021. 3. 9.
Tip Adjust Navigation Graph gradle(app) dependencies { def nav_version = "2.3.3" implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" implementation "androidx.navigation:navigation-ui-ktx:$nav_version" ... } File - New - Android Resouce Directory New Resouce Directory - Resouce Type - navigation - OK MainActivity.kt class MainActivity : AppCompatActivity(R.layout.activity_main) .. 2021. 2. 15.
Navigation Graph developer.android.com/guide/navigation/navigation-getting-started 탐색 구성요소 시작하기 | Android 개발자 | Android Developers 이 주제는 탐색 구성요소를 설정하고 사용하는 방법을 설명합니다. 탐색 구성요소의 대략적인 개요는 탐색 개요를 참고하세요. 환경 설정 참고: 탐색 구성요소는 Android 스튜디오 3.3 이상이 필요 developer.android.com Include the Jetpack Navigation library Add a NavHost to the activity Create a navigation graph Add fragment destinations to the navigation graph nav_gr.. 2021. 2. 11.
MainActivity.kt Code in the MainActivity class class MainActivity : AppCompatActivity(R.layout.activity_main) is same as the following code using the default AppCompatActivity constructor: class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.main_activity) } } 2021. 2. 11.
[Jetpack Kotlin Android] ViewModel Add a ViewModel 1. In the Android window of your Android Studio under the Gradle Scripts folder, open the file build.gradle(Module:Example.app). 2. To use the ViewModel in your app, verify that you have the ViewModel library dependency inside the dependencies block. dependencies { ... // ViewModel implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0' } Always use the latest version o.. 2021. 2. 9.
Notes... Note: When you override the onCreate() method, you must call the superclass implementation to complete the creation of the Activity, so within it, you must immediately call super.onCreate(). The same is true for other lifecycle callback methods. Note: A good convention is to declare a TAG constant in your class: const val TAG = "MainActivity" and use that in subsequent calls to the log methods, .. 2021. 2. 9.
[Android Studio, Windows 10] Starting Emulator with Consol 매번 안드로이드 에뮬레이터를 안드로이드 스튜디오로 들어가서 켜는게 불편했다. 그리하여 콘솔을 통해 열 수 있는 방법을 찾아보았고 공유하고자 한다. 1. Install Android Emulator with Android Studio Ctrl + Alt + S 를 눌러 Setting을 켜준다. Appearance & Behavior > System Settings > Android SDK 로 들어간다. 두번째 탭 SDK Tools를 들어간다. Android Emulator를 설치해준다. 위의 Android SDK Location 의 Path를 복사해준다. 2. Setting Path 제어판 > 사용자 계정 > 환경 변수 변경 [UserName]에 대한 사용자 변수 > Path 선택 > 편집 > 새로만들기 .. 2020. 11. 20.
[Android Studio] 프로젝트 내의 원하는 문자열 찾기 Find in Path... Edit - Find - Find in Path... 단축키 : Ctrl + Shift + F (in Windows,Mac) 문자열이 포함된 라인의 위치를 알려주고 선택하면 소스가 아래 창에 떠서 바로 수정할 수도 있다. 2020. 6. 18.
[Android Studio] 라이브러리 참조 / 직접 경로 입력 Gradle Script bulid.gradle (당연하게 Module:app) dependencies { 참조할 라이브러리 주소 } dependencies { implementation 'com.github.bumptech.glide:glide:4.11.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0' } 2020. 6. 18.
반응형