묻고 답해요
161만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
D-DAY앱 디데이 계산에 오류가 있는데 해결하고싶어요
9월 19일과 9월 20일 선택 시 1일 차이로 잘 나옵니다.하지만 8월 31일과 9월 1일 선택 시 0일 차이로 나옵니다. Log찍어보면 두 날짜의 밀리초가 같게 나옵니다. 이유가 궁금합니다! (다른 방법 찾아서 해도 밀리초를 변환해서 계산하는 방법은 다 같은 결과가 나왔습니다.) package com.yndoo.dday import android.app.DatePickerDialog import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.util.Log import android.widget.Button import android.widget.DatePicker import android.widget.TextView import org.w3c.dom.Text import java.text.SimpleDateFormat import java.util.Calendar import java.util.GregorianCalendar import java.util.concurrent.TimeUnit class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val startButton = findViewById<Button>(R.id.startBtn) val endButton = findViewById<Button>(R.id.endBtn) var startDate = "" var endDate = "" var calendar_start = Calendar.getInstance() var calendar_end = Calendar.getInstance() startButton.setOnClickListener { val today = GregorianCalendar() val year = today.get(Calendar.YEAR) val month = today.get(Calendar.MONTH) val day = today.get(Calendar.DATE) val dlg = DatePickerDialog(this, object: DatePickerDialog.OnDateSetListener{ override fun onDateSet(view: DatePicker?, year: Int, month: Int, dayOfMonth: Int) { startDate = "${year}${month+1}${dayOfMonth}" Log.d("날짜확인1",startDate) calendar_start.set(year, month+1, dayOfMonth) calendar_start.apply { set(Calendar.HOUR_OF_DAY, 0) set(Calendar.MINUTE, 0) set(Calendar.SECOND, 0) set(Calendar.MILLISECOND, 0) } } }, year, month, day) dlg.show() } endButton.setOnClickListener { val today = GregorianCalendar() val year = today.get(Calendar.YEAR) val month = today.get(Calendar.MONTH) val day = today.get(Calendar.DATE) val dlg = DatePickerDialog(this, object: DatePickerDialog.OnDateSetListener{ override fun onDateSet(view: DatePicker?, year: Int, month: Int, dayOfMonth: Int) { endDate = "${year}${month+1}${dayOfMonth}" Log.d("날짜확인2",endDate) calendar_end.set(year, month+1, dayOfMonth) calendar_end.apply { set(Calendar.HOUR_OF_DAY, 0) set(Calendar.MINUTE, 0) set(Calendar.SECOND, 0) set(Calendar.MILLISECOND, 0) } val finalDate = TimeUnit.MILLISECONDS.toDays(calendar_end.timeInMillis - calendar_start.timeInMillis) + 1 //val finalDate = (calendar_end.timeInMillis - calendar_start.timeInMillis)/(24*60*60*1000) + 1 Log.d("@@@",TimeUnit.MILLISECONDS.toDays(calendar_start.timeInMillis).toString()) Log.d("@@@",TimeUnit.MILLISECONDS.toDays(calendar_end.timeInMillis).toString()) findViewById<TextView>(R.id.ddayText).setText("D+" + finalDate.toString()) } }, year, month, day) dlg.show() } } }
-
해결됨[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
프래그먼트 오류가 납니다!
5강의 내비게이션 프래그먼트 강의 수강 중 오류가 납니다.코드 작성 시 빨간 줄 뜨는 건 없었는데 실행 시키면 arr metadata 체크 할 때 8개의 오류가 난다고 뜹니다 8 issues were found when checking AAR metadata: 1. Dependency 'androidx.navigation:navigation-common:2.7.2' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 2. Dependency 'androidx.navigation:navigation-common-ktx:2.7.2' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 3. Dependency 'androidx.navigation:navigation-runtime:2.7.2' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 4. Dependency 'androidx.navigation:navigation-ui:2.7.2' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 5. Dependency 'androidx.navigation:navigation-runtime-ktx:2.7.2' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 6. Dependency 'androidx.navigation:navigation-ui-ktx:2.7.2' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 7. Dependency 'androidx.navigation:navigation-fragment-ktx:2.7.2' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 8. Dependency 'androidx.navigation:navigation-fragment:2.7.2' requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs. :app is currently compiled against android-33. Recommended action: Update this project to use a newer compileSdk of at least 34, for example 34. Note that updating a library or application's compileSdk (which allows newer APIs to be used) can be done separately from updating targetSdk (which opts the app in to new runtime behavior) and minSdk (which determines which devices the app can be installed on). 이건 33으로 되어 있는데 34로 바꾸면 실행 버튼이 비활성화 됩니다.이것도 제대로 되어 있는 거 같은데 뭐가 문젤까요ㅠ
-
미해결[초중급편] 안드로이드 데이팅 앱 만들기(Android Kotlin)
핸드폰 이미지 불러오기 방법들
현재 '핸드폰 이미지 불러오기' 강의를 듣고있는데 저번에 '안드로이드 커뮤니티 앱 만들기'에서는 핸드폰의 이미지를 불러올때 fun getProfileImg() { joinBinding.imageArea.setOnClickListener { val gallery = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.INTERNAL_CONTENT_URI) startActivityForResult(gallery, 100) } } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { super.onActivityResult(requestCode, resultCode, data) if (resultCode == AppCompatActivity.RESULT_OK && requestCode == 100) { joinBinding.imageArea.setImageURI(data?.data) } }이런식으로 하셨잖아여. 이번에도 이렇게 하니까 정상 작동하더라고요! 이번에는 fun getProfileImg() { val getAction = registerForActivityResult( ActivityResultContracts.GetContent(), ActivityResultCallback { uri -> joinBinding.imageArea.setImageURI(uri) } ) joinBinding.imageArea.setOnClickListener { getAction.launch("image/*") } }이런식으로 하고계시잖아요. 두방법간의 차이가 뭔가요? 아니면 더 좋은방법을 알아내신건가요?
-
미해결[초중급편] 안드로이드 데이팅 앱 만들기(Android Kotlin)
상황별 어떤 레이아웃을 쓰는게 좋을까요?
'유저 정보 받아오기' 강의를 들으면서 item_card.xml의 layout_height 가 500dp 로 되어있어서<ImageView android:id="@+id/profileImageArea" android:layout_width="match_parent" android:layout_height="500dp"/>이런식으로 지역이 가려지더라고요결국 그부분을 450dp로 줄여서 해결하긴했는데,만약 핸드폰 비율에 따라서 똑같은 비율로 적용을 하려면 constraintlayout 을 사용해야되는거죠?제가 느끼기로는 constraintlayout 이 LinearLayout보다 비율맞추기도 쉽고 디자인탭에서만으로도 정렬이 되는거 같아서 편해서, 혼자 앱만들다보면 constraintlayout을 남발할꺼같은데 실무에서는 어떤 레이아웃들이 많이 쓰이나요?지금은 혼자 만들어볼때 특별한 기준없이 그냥 손에 잡히는 레이아웃으로 하고있는데, 어느 상황때 무슨 레이아웃을 쓰는 습관을 들여야 좋을지할지 궁금합니다!
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
bts 앱 만들기 오류 질문입니다.
이렇게 오류가 나타납니다.Unresolved reference: findviewById
-
해결됨[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
안녕하세요? 질문 있습니다.
트와이스 앱 스플래시를 잘라내고 붙이는 부분에서,코드를 똑같이 했음에도 불구하고 오류가 나서강사님이 다른 답변에 코드를 달아 주신 것을 복붙하니 되었습니다.'SplashActiviy 부분의 영역이 intent-filter 부분을 감싸지 않는 것 같은데' 라고답변을 하신 걸 보았는데, 혹시 이게 무슨 말씀이신지 설명해 주실 수 있나요?감사합니다.
-
미해결[초중급편] 안드로이드 데이팅 앱 만들기(Android Kotlin)
CardStackView 를 쓰려면 반드시 이전버전을 사용해야되나요?
인프런질문이전버전 설치 유튜브저도 같은 문제인데 꼭 이전버전으로 사용해야되는건가요?저는 최신버전인 Android Studio Giraffe | 2022.3.1버전 사용하고있는데 노션에 쓰여있는 해결방안인implementation("com.yuyakaido.android:card-stack-view:2.3.4") // cardView을 추가했음에도 이런식으로 적용이 안됩니다! 이전버전을 설치하는거 말고는 방법이 없을까요?
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
리니어 레이아웃
Q.레이아웃 없이 이미지들로만 구성해도 되지 않나요?리니어 레이아웃을 틀로 두고 그 안에 이미지뷰 태그로 이미지들을 하나씩 넣어준건데,리니어 레이아웃 없이이제 ImageView태그들로만 구성해서 저런형태를 만들어 줄 수도 있지 않나요?
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
MainActivity파일외 다른 파일들의 병합
저런 파일들 안만들고 main액티비티 파일 하나 안에다 넣어줘서 만들어줄수도 있지 않나요?굳이 저런식으로 파일들을 만들어서 해줘야 하나요?
-
미해결[초중급편] 안드로이드 데이팅 앱 만들기(Android Kotlin)
AAC, MVVM, DI등은 어떤 후속강의에 나오나요?
[중급편] 친절한 JETPACK 개론 <상>[중급편] 코인 가격 모니터링 앱 제작[중급편] 친절한 JETPACK 개론 <하>이렇게 후속강의 있는데 이것들 차례대로 공부하다보면 자연스럽게 익혀지는거겠죠? 아님 아직 안나왔나여?
-
미해결MERN STACK 커뮤니티 : 시작부터 배포까지 알려주는 React
두번씩 실행되는 문제..
왜 두번 실행되는 건지 모르겠어요..어디가 잘못된걸까요??
-
해결됨풀스택 리액트 라이브코딩 - 간단한 쇼핑몰 만들기
productdetail 데이터 안불러와지고 있습니다.
전체 목록까지는 불러와 지는데 상세페이지가 안되고 있습니다.rest까지는 됐었는데 graphql로 바꾸면서 잘안돼고 있네요...정상적으로 query key와 id는 잘 들어가는것 같습니다.https://github.com/littleduck1219/Web_Toy_Project/tree/main/shopping-mall
-
해결됨[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
데이터바인딩 오류가 납니다
안녕하세요! 데이터바인딩 첫번째 강의에서 데이터바인딩 enabled true 부분에서 오류가 나서 글을 남깁니다Unexpected tokens (use ';' to separate expressions on the same line) 라는 오류 문구가 떠서 중간에 ;를 삽입해봤는데요더 난리가 났습니다..
-
미해결[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
어떻게 저것만 작성했는데 동적으로 삭제가 되는지 이해가 안가요
'북마크 동적으로 삭제'강의에서bookmarkIdList.remove(key)만 추가했더니 ui상에서 지워지는지 이해가 안갑니다! if(bookmarkIdList.contains(key)) { contentRvItemBinding.bookmarkArea.setImageResource(R.drawable.bookmark_color) } else { contentRvItemBinding.bookmarkArea.setImageResource(R.drawable.bookmark_white) } // setOnClickListener가 여기 아래에 있고 색깔 칠하는 로직은 그위에 있음 contentRvItemBinding.bookmarkArea.setOnClickListener { if(bookmarkIdList.contains(key)) { bookmarkIdList.remove(key) // 북마크 동적으로 삭제하는코드 위의 코드에서 bookmarkIdList에 따라 색깔을 칠할지 안칠할지 결정하는 코드는 아래 코드이고 if(bookmarkIdList.contains(key)) { contentRvItemBinding.bookmarkArea.setImageResource(R.drawable.bookmark_color) } else { contentRvItemBinding.bookmarkArea.setImageResource(R.drawable.bookmark_white) } setOnClickListener 밖에 있습니다. 근데 북마크버튼을 클릭을 하면 저코드가 실행되어서 색깔을 칠해주거나 없애줍니다.제 생각으로는 북마크를 클릭하면 setOnClickListener안에서만 코드가 돌아야되는거 아닌가 생각했는데 왜 밖에 있는 코드가 실행되는지 이해가 안갑니다!!
-
미해결[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
realtimeDB에서 북마크 리스트 만들때 key를 똑같이 하는이유
'북마크 데이터 저장' 강의에서 북마크 데이터를 저장할때 키값을 기존 contents에 있는 key값으로 넣어주는 이유가 있을까요?저번 왕초보편에서는 그냥 bookmark의 child로 유저의uid만 넣고 key값은 신경을 안썼던거 같은데 이번에는 북마크할 컨텐츠의 key값도 받아와서 그값으로 저장을 하시길래 그렇게 하면 어떤 장점들이 있는지 궁금합니다!!<왕초보편 방식>contentRvItemBinding.bookmarkArea.setOnClickListener { val myBookmarkRef = database.getReference("bookmark") val title = contentModel.title val imageTitle = contentModel.imageTitle val url = contentModel.url val model = ContentModel(title, imageTitle, url) myBookmarkRef .child(Firebase.auth.currentUser!!.uid) .push() .setValue(model) Toast.makeText(context, contentModel.title, Toast.LENGTH_SHORT).show() } <현재>contentRvItemBinding.bookmarkArea.setOnClickListener { FBRef.bookmarkRef .child(FBAuth.getUid()) .child(key) .push() .setValue("good") Toast.makeText(context, "${contentRvItemBinding.textArea.text} 북마크 등록", Toast.LENGTH_SHORT).show() }
-
미해결MERN STACK 커뮤니티 : 시작부터 배포까지 알려주는 React
스타일 깃허브에서 코드 가져가라고 하셨는데요
강의에서는 깃허브 참고하라 하시고 깃허브 링크를 안 올려놓으셔서개인적으로 이메일도 보냈으나 묵묵부답이십니다코드 좀 보고싶은데 제발 회신 좀 해주세요~~~~!~!~!~
-
미해결[초급편] 안드로이드 커뮤니티 앱 만들기(Android Kotlin)
오류가 뜨는데 해결 방법이 있을까요?
(사진)
-
미해결[왕초보편] 앱 8개를 만들면서 배우는 안드로이드 코틀린(Android Kotlin)
class MainActivity : FragmentActivity()로 작성을 해야지 실행이 됩니다.
앱실행시 계속 오류가나서이것저것 알아본결과Main Activity.kt의class MainActivity : AppCompatActivity()를class MainActivity : FragmentActivity()로 바꾸어 실행하였더니 실행되었습니다. 최근에 컴퓨터를 바꿔서 안드로이드 스튜디오를 새로 깔았는데 혹시 이게 원인이 될 수 있을까요? 최신버전에서 NavHostFragment를 사용하기 위해서는 AppCompatActivity()를 사용해야 동작하는 건가요?
-
해결됨풀스택 리액트 라이브코딩 - 간단한 쇼핑몰 만들기
query 에러 발생했습니다.
Unexpected Application Error!No QueryClient set, use QueryClientProvider to set oneError: No QueryClient set, use QueryClientProvider to set one at useQueryClient (http://localhost:3000/node_modules/.vite/deps/chunk-PPRRYNMJ.js?v=afce5f27:2826:11) at useBaseQuery (http://localhost:3000/node_modules/.vite/deps/chunk-PPRRYNMJ.js?v=afce5f27:3003:23) at useQuery (http://localhost:3000/node_modules/.vite/deps/chunk-PPRRYNMJ.js?v=afce5f27:3051:10) at ProductList (http://localhost:3000/src/pages/products/index.tsx?t=1694339505145:26:7) at renderWithHooks (http://localhost:3000/node_modules/.vite/deps/chunk-MMW4JUSU.js?v=afce5f27:12169:26) at mountIndeterminateComponent (http://localhost:3000/node_modules/.vite/deps/chunk-MMW4JUSU.js?v=afce5f27:14919:21) at beginWork (http://localhost:3000/node_modules/.vite/deps/chunk-MMW4JUSU.js?v=afce5f27:15900:22) at beginWork$1 (http://localhost:3000/node_modules/.vite/deps/chunk-MMW4JUSU.js?v=afce5f27:19747:22) at performUnitOfWork (http://localhost:3000/node_modules/.vite/deps/chunk-MMW4JUSU.js?v=afce5f27:19192:20) at workLoopSync (http://localhost:3000/node_modules/.vite/deps/chunk-MMW4JUSU.js?v=afce5f27:19131:13)import { Suspense, useEffect } from "react"; import { getClient } from "./queryClient"; import { QueryClientProvider } from "@tanstack/react-query"; import { ReactQueryDevtools } from "@tanstack/react-query-devtools"; import { routes } from "./routes"; import { useRoutes } from "react-router-dom"; const App = () => { const elem = useRoutes(routes); const queryClient = getClient(); console.log("QueryClient:", queryClient); // useEffect(() => { console.log("QueryClientProvider is mounted."); }, []); return ( <QueryClientProvider client={queryClient}> <Suspense fallback={<div>Loading...</div>}>{elem}</Suspense> <ReactQueryDevtools initialIsOpen={false} /> </QueryClientProvider> ); }; export default App; import React from "react"; export const DynamicIndex = React.lazy(() => import("./pages/index")); export const DynamicProductsIndex = React.lazy(() => import("./pages/products/index")); export const DynamicProductsId = React.lazy(() => import("./pages/products/[id]"));import GlobalLayout from "./pages/_layout"; import * as Lazy from "./Lazy"; export const routes = [ { path: "/", element: <GlobalLayout />, children: [ { path: "/", element: <Lazy.DynamicIndex />, index: true }, { path: "/products", element: <Lazy.DynamicProductsIndex />, index: true }, { path: "/products/:id", element: <Lazy.DynamicProductsId /> }, ], }, ]; export const pages = [{ route: "/" }, { route: "/products" }, { route: "/products/:id" }]; queryclient와 queryprovider를 잘 설정한것 같은데 에러가 발생하고 있습니다. 거의 4시간 가까이 찾아본것 같습니다.. Lazy부분은 따로 분리를 안하면 경고를 띄워서 분리를 했습니다. 이리저리 만져서 tool도 안뜨는걸 뜨게 했는데 저 에러는 도저히 해결이 안되네요 ... https://github.com/littleduck1219/Web_Toy_Project/tree/main/shopping-mall
-
미해결파이어베이스(Firebase)를 이용한 웹+안드로이드 메모 어플리케이션 만들기
강의 자료 어딨는지 알려주세요 ㅎ
구름 모양아이콘이라 하는데 못찾겠네요 ㅎㅎ;;;;