묻고 답해요
167만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결자바 개발자를 위한 코틀린 입문(Java to Kotlin Starter Guide)
kotlin closure 는 별도의 메모리 공간에 데이터를 복사해서 가지고 있는게 맞을까요?
Java 에서 Final 만 사용할 수 있는게 외부 변수가 메모리에서 해제 되었을 경우, 가비지를 참조할 수 있는 것을 방지하기 위해서로 알고 있는데 코틀린은 이게 가능한게 아예 메모리를 통째로 떠와서 그런걸까요? ㅎㅎ강의 영상에서 포획한다 라고 표현하신게 그런 의미 같아요!
-
해결됨자바 개발자를 위한 코틀린 입문(Java to Kotlin Starter Guide)
Kotlin 에서는 함수형 인터페이스가 필요 없어진걸까요?
함수가 1급객체가 되어버려서 functional interface가 필요없어진 것처럼 보여요
-
미해결자바 개발자를 위한 코틀린 입문(Java to Kotlin Starter Guide)
코틀린 Companion object
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 안녕하세요! 선생님! 수업을 잘 듣고있는 백엔드 취준생 입니다!자바를 공부하다가 코틀린도 공부하면 좋을꺼 같아서 같이 공부하고있는데요..혹시 좀더 코틀린을 딥하게 파보고 싶은데 추천하시는 사이트 혹시 있으실까요??
-
미해결[중급편] 친절한 JETPACK 개론 <하> (Android Kotlin)
질문드립니다!
챕터9에 검색한 데이터 요청 챕터에서 viewmodel과 viewmodelfactory로 나눈 이유가 있을까요?
-
미해결코틀린 3강으로 끝내기 feat. 안드로이드 개발
3강에서 MainActivity.kt에서 activity_main.xml에 있는 nav_host_fragment를 가져오는게 안됩니다
분명히 activity_main.xml코드도 똑같고 MainActivity.kt 코드도 똑같은데 nav_host_fragment가 Unresolved Reference라고 뜨네요... 혹시 같은 오류 뜨셔서 해결하신 분 있으실까요? 아니면 제 컴퓨터 환경 문제일까요? ㅠㅠ
-
해결됨실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)
예외 처리 리팩토링 질문
안녕하세요.강의 들으며 재밌고 공부하고 있습니다. 감사합니다.예외 처리를 util패지키에 모아서 처리하는 것은 이해했습니다. 약간 궁금증 생겨서 문의 남겨봅니다!BookService의 코드 일부분 입니다. 여기서 보면 UserRepository와 BookRepository의 findByName에서 모두 fail()로 예외 처리를 하는데요, 이걸 그냥 리포지토리 계층의 메서드 자체에서 예외를 처리해주면 더 깔끔하지 않을까 하는 궁금증이 생겼습니다. 제가 지금까지 공부하면서는 리포지토리 계층에서 디폴트 메서드를 통해서 처리하는 코드도 봤고, 서비스 계층에서 처리하는 코드도 봐서 어떤 방식을 선호하시는지, 권장 하시는지 궁금합니다! 좋은 강의 감사합니다!
-
미해결실전! 코틀린과 스프링 부트로 도서관리 애플리케이션 개발하기 (Java 프로젝트 리팩토링)
와 진짜 대박이네요 디폴트 파라미터 하나로 이렇게 편해질수가 ㅜ
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 자바 스프링에서는 테스트용 생성자 메서드가 있어도, 매번 일일히 null을 넣어준다거나 하는 문제점들이 있어서 결국 Builder를 사용했었는데코틀린에서는 롬복 Builder가 지원되지 않는다고 해서 엄청 고민 중이였습니다근데 이번 강의 보니까 그냥 온전한 객체 만들어주는 팩터리 메서드 하나 만들어놓고 테스트용으로 필요한 인자 값들만 설정해주면 되는 거였군요진짜 미쳤다.. 갓틀린..잘 배워갑니다..
-
해결됨토비의 스프링 부트 - 이해와 원리
코틀린 코드로 변경해서 학습을 진행중이신 모든 분들께 질문이 있습니다.
package deepboot.deep.config.autoconfig import deepboot.deep.annotation.ConditionalMyOnClass import deepboot.deep.annotation.MyAutoConfiguration import org.springframework.beans.factory.annotation.Value import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory import org.springframework.boot.web.servlet.server.ServletWebServerFactory import org.springframework.context.annotation.Bean import org.springframework.core.env.Environment @MyAutoConfiguration @ConditionalMyOnClass("org.apache.catalina.startup.Tomcat") class TomcatWebServerConfig() { @Value(value = "\${context.path}") lateinit var contextPath: String @Bean("tomcatWebServerFactory") @ConditionalOnMissingBean fun servletWebServerFactory(env: Environment): ServletWebServerFactory { val factory = TomcatServletWebServerFactory() println("contextPath: $contextPath") factory.contextPath = this.contextPath return factory } } 현재 제 TomcatWebServerConfig() 전체 코드입니다.contextPath 를 출력했을 때 결과가contextPath: ${context.path}위 처럼 나오고, IllegalArgumentException 이 발생합니다. ContextPath must start with '/' and not end with '/'제가 생각했을 때 이 @Value 를 제대로 못 읽어오는 것 같은데, 코틀린 클래스 생성자 파라미터로 contextPath 를 주입해도, lateinit var 로 선언해도 여전히 properties 에서 값을 못 읽어오네요. 이런 동일 증상 겪으신 분 어떻게 해결했는지 궁금합니다.아래는 전체 코드 깃허브 주소입니다.https://github.com/dailyzett/deep도와주시면 정말 감사하겠습니다.chatGPT 로도 계속 물어보고 있는데 제자리만 돌고 있는 느낌이네요.
-
미해결자바 개발자를 위한 코틀린 입문(Java to Kotlin Starter Guide)
안녕하세요. 람다에서 외부변수를 사용하는 Closure관련해 궁금해 질문드려요.
안녕하세요. 먼저 질좋은 강의 만들어주시고 제공해주셔서 감사드려요!강의중 Closure가 자바와 다르게 final이 아닌 var변수를 람다안에서 값을 변경가능한것까지 이해하였습니다. 다른 궁금증이 하나 생겨서요. Closure가 람다를 진입하기전 변수를 포획해서 진행한다고 하셨는데, 이는 동시성 문제로부터 자유롭나요?
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
에뮬레이터가 에러가 나는 경우는 어떤 문제인가요
bts 어플 만들기에서 bts_1 파일까지는 잘 됐는데액티비티 화면 전환을 시도할려고 코드를 짜다보니다른 이미지를 선택했을때 자꾸 바탕화면으로 튕기고 계속 시도하니 오류가 납니다 나머지 이미지 파일이나 레이아웃 코드는 모두 복붙했고 메인 액티비티도 코드는 강의내용 그대로 옮겨 적었습니다
-
해결됨[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
isEmpty가 unresolved references 오류
isEmpty함수를 따라 쓰려 하자 unresolved references 오류가 발생하며 사용할 수 없어서 대체로 length가 0인 것을 하려고 하자 노란줄이 뜨면서 isEmpty를 추천해주는데 여전히 사용이 안되는데 혹시 왜 그런지 아시나요?
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
메타데이터 에러
안녕하세요.이미지 세팅하고 시작 누르는데 맨 밑과 같은 에러가 나오는데요. 아래 2가지 방법을 시도해도 작동이 안되는데 혹시 어떻게 해야 하나요? } https://devshin93.tistory.com/116 참조:-> 첫 번재 해결책 : compileSdk 와 targetSdk 가 31이 아닌 경우,implementation 'androidx.appcompat:appcompat:1.3.0'> 두 번째 해결책 : compileSdk 과 targetSdk 가 31인 경우 걍 해결 됨! AAR 메타데이터를 확인하는 동안 6가지 문제가 발견되었습니다:
-
해결됨[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
firebase 관련 import에서 오류가 발생합니다
auth 부분에서도 import가 되지 않는 오류가 발생했는데 이전에는 방법을 찾아서 무시하고 일단 넘어갔는데 realtime database에서도 여전히 문제가 발생합니다.다음과 같이 Firebase를 import하려고 하면 Unresolved reference:Firebase라고 뜹니다. import 선택지는 뜨지도 않고요.. 이전에 auth에서도 동일한 문제가 발생했는데 어떻게 고치고 왜 그런지 아시나요? implementation도 추가했습니다
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
강의자료와 소스코드는 어디서 받을수 있나요?
강의 제목 옆에 구름 아이콘이나 수업자료 버튼이 보이지 않습니다ㅠ
-
해결됨토비의 스프링 부트 - 이해와 원리
코틀린 AnnotationConfigWebApplicationContext 관련 이슈
AnnotationConfigWebApplicationContext 익명함수가 잘 만들어지시나요?저 같은 경우에 어떤 문제인지 모르겠는데 익명함수를 만들면 setClassLoader() 메소드를 오버라이딩하라는 컴파일 에러를 만나게 됩니다.찾아본 결과 부모 클래스인 DefaultResourceLoader 에서 해당 메소드를 이미 구현하고 있는데 왜 다시 구현하라는지 모르겠습니다.심지어 아래와 같이 overriding 해도 에러가 발생합니다. fun main(args: Array<String>) { val applicationContext = object : AnnotationConfigWebApplicationContext() { @Override override fun onRefresh() { super.onRefresh() val tomcatWebServerFactory = TomcatServletWebServerFactory() val webServer = tomcatWebServerFactory.getWebServer({ servletContext -> servletContext.addServlet("dispatcherServlet", object : DispatcherServlet(this) { }).addMapping("/*") }) webServer.start() } @Override override fun setClassLoader(classLoader: ClassLoader) { super.setClassLoader(classLoader) } } applicationContext.apply { refresh() } } 이런 에러가 발생합니다. fun setClassLoader(classLoader: ClassLoader): Unit defined in tobyspring.helloboot.main.<no name provided> fun setClassLoader(classLoader: ClassLoader?): Unit defined in tobyspring.helloboot.main.<no name provided> 해결하신분이 계시다면 꼭 부탁 드리겠습니다..!
-
미해결[중급편] 코인 가격 모니터링 앱 제작 (Android Kotlin)
오류가 생성되는데 왜 생기는지 궁금해서 질문드립니다
E/RecyclerView: No adapter attached; skipping layoutE/RecyclerView: No adapter attached; skipping layout coinListFragment 에서 생성되는 오류라고 생해서 관련된 부분을 수정해보았으나 계속해서 오류가 생성되서 왜 생기는걸까? 궁금해서 질문드립니다. 오류와 관계없이 화면에 리사이클러뷰는 잘 나오기때문에 넘어가도 상관없겠다 싶지만서도 왜 저런 오류가 생기는지 궁금해서 질문 합니다.처음에는 XML 상에서도 layoutManager 를 지정해줘야 하나 싶어서 했으나 나타났고, 다음으로는 context 관련 문제인가 싶어서 해당하는 부분을 수정하다가 오히려 더 오류가 발생하였습니다...ㅋㅋㅋ기능에는 문제가 없기 때문에 넘어가도 괜찮지만 순수하게 궁금해서 질문합니다. 아니면 혹시, coinListFragment 쪽의 RecyclerView 가 아닌, Intro 에서 좋아하는 코인을 만들때 의 오류메시지 일까요?
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
FireBase 익명로그인 실패
강사님 말씀대로 했는데 익명 로그인 부분에서 else(익명로그인 실패)부분이 뜨네요
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
에러코드
Run 돌리면 자꾸 에러가 떠서 그냥 아무 코드 입력없이 새 프로젝트를 만들어 돌려도 다음과 같은 에러코드가 뜹니다. 원인이 무엇일까요?? 6 issues were found when checking AAR metadata: 1. Dependency 'androidx.appcompat:appcompat-resources:1.6.1' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. :app is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 2. Dependency 'androidx.appcompat:appcompat:1.6.1' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. :app is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 3. Dependency 'androidx.activity:activity:1.6.0' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. :app is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 4. Dependency 'androidx.core:core:1.9.0' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. :app is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 5. Dependency 'androidx.core:core-ktx:1.9.0' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. :app is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on). 6. Dependency 'androidx.annotation:annotation-experimental:1.3.0' requires libraries and applications that depend on it to compile against version 33 or later of the Android APIs. :app is currently compiled against android-32. Recommended action: Update this project to use a newer compileSdkVersion of at least 33, for example 33. Note that updating a library or application's compileSdkVersion (which allows newer APIs to be used) can be done separately from updating targetSdkVersion (which opts the app in to new runtime behavior) and minSdkVersion (which determines which devices the app can be installed on).
-
미해결냉동코더의 알기 쉬운 Modern Android Development 입문
안녕하세요. 용어에 대해 질문이 있어 글 남깁니다.
안녕하세요. 강의 잘듣고 있습니다.다만, 제가 이 강의부터 시작해서 그런지 용어에 대한 개념이 헷갈립니다. util 디렉토리와 source.kt 파일의 역할은 정확히 무엇인가요?util 디렉토리에 들어가는 파일들의 내용은 무엇이고,DataSource의 역할이 무엇인지 궁금합니다 !감사합니다..
-
해결됨[중급편] 코인 가격 모니터링 앱 제작 (Android Kotlin)
Button을 사용하는 경우와 TextView를 사용하는 경우에 대해 차이가 궁금합니다.
안녕하세요 강의 막바지를 향해 달려가고 있던 중 궁금한 점이 있습니다.SelectActivity에서 다음 MainActivity로 넘어가기 위해 onClick 이벤트를 TextView를 통해 처리하는 것을 보았습니다. 그런데 SettingActivity에서는 Button을 생성하는 것을 보고 TextView를 통해 클릭 이벤트를 처리하는 것과 Button을 통해 이벤트를 처리하는 것에 대한 차이가 있는지 궁금합니다.혹은 개발자님만의 상황에 따른 사용 기준이 따로 있나요??유익한 강의 너무 잘 듣고 있습니다. 감사합니다