전체 글208 <코틀린 Kotlin> 안드로이드 파이어베이스 휴대폰인증 우선 파이어베이스 콘솔에 들어가주세요. https://console.firebase.google.com/ 로그인 - Google 계정 하나의 계정으로 모든 Google 서비스를 Google 계정으로 로그인 accounts.google.com 프로젝트를 들어가주시면 왼쪽에 Authentication을 들어가주세요. 로그인 방법 설정 클릭 새 제공업체 추가 전화버튼 클릭 사용 설정을 체크해주세요. 여기서 안드로이드 클릭하시면 기본적인 의존성추가부분이 나옵니다. 저는 implementation platform('com.google.firebase:firebase-bom:29.0.2') implementation 'com.google.firebase:firebase-analytics-ktx' 이렇게 추가했습니다.. 2022. 2. 15. 코틀린 네트워크 상태 체크 fun getNetWorkStatusCheck(context : Context) : Boolean { val connectManager = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager val networkStatus : NetworkInfo? = connectManager.activeNetworkInfo val connectCheck : Boolean = networkStatus?.isConnectedOrConnecting == true return connectCheck } when(getNetWorkStatusCheck(applicationContext)){ true -> //네트워크 연결됨 false-> .. 2022. 2. 4. 코틀린 안드로이드 핸드폰번호 국가코드로 변환시키기 fun phoneNumber82(msg : String) : String{ val firstNumber : String = msg.substring(0,3) var phoneEdit = msg.substring(3) when(firstNumber){ "010" -> phoneEdit = "+8210$phoneEdit" "011" -> phoneEdit = "+8211$phoneEdit" "016" -> phoneEdit = "+8216$phoneEdit" "017" -> phoneEdit = "+8217$phoneEdit" "018" -> phoneEdit = "+8218$phoneEdit" "019" -> phoneEdit = "+8219$phoneEdit" "106" -> phoneEdit = "+8.. 2022. 2. 4. 코틀린 안드로이드 핸드폰번호 패턴체크 fun isPhoneNumberCheck(cellphoneNumber : String) : Boolean { var returnValue = false; val regex = "^\\s*(010|011|012|013|014|015|016|017|018|019)(-|\\)|\\s)*(\\d{3,4})(-|\\s)*(\\d{4})\\s*$"; val p = Pattern.compile(regex); val m = p.matcher(cellphoneNumber); if (m.matches()) { returnValue = true; } return returnValue; } 사용 가능하면 true 그렇지 않으면 false를 반환합니다. 2022. 2. 3. 이전 1 ··· 10 11 12 13 14 15 16 ··· 52 다음