Android 5

Kotlin + Retrofit2 + Okhttp3을 활용한 REST API 기본 메소드 작성

Manifest build.gradle(app)에 아래와 같은 내용 추가 (*1.8 관련 내용 추가 안할 시, NoSuchMethodError 발생) android { ... compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } kotlinOptions { jvmTarget = "1.8" } ... } dependencies { ... //Retrofit2 implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-gson:2.9.0' //Ok..

Before 2022/Android 2020.07.16

AndroidX의 Android Security를 활용한 SharedPreferences 암호화

build.gradle(app)에 아래와 같은 dependency 추가 dependencies { ... implementation 'androidx.security:security-crypto:1.1.0-alpha01' ... } import android.content.Context import android.content.SharedPreferences import android.security.keystore.KeyGenParameterSpec import android.security.keystore.KeyProperties import android.util.Log import androidx.security.crypto.EncryptedSharedPreferences import androi..

Before 2022/Android 2020.07.16

USIM 관리 클래스 총정리(유심 체크, 번호 가져오기, 번호 포맷 통일)

안드로이드 현재 단말기가 더블 유심일 경우 전화번호를 가져오는 메소드 안드로이드 현재 단말기가 더블 유심일 경우 전화번호를 가져오는 메소드 public void setPhoneNumSpinner() { // API LEVEL 22 이상에서 가능 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) { // 단말기 정보를 가져오는 클래스 SubscriptionManager subscriptionMan.. gooners0304.tistory.com 와 같은 글을 예전에 업로드한 적이 있었다. 하지만, 코드를 작성하던 중 아래와 같은 문제가 있었고 이 글은 그 모든 상황에 대비한 유틸 클래스에 대한 내용이다. 1. 통신사마다 전화번호 포맷이 동일하지않..

Before 2022/Android 2019.06.17