๋ชฉ๋ก์ ์ฒด ๊ธ (113)
๐ฑ dreaming DiNO
adb tcpip 5555 adb connect 192.168.1.48
๋๋ค ํจ์ํ ํ๋ก๊ทธ๋๋ฐ์ ์ปฌ๋ ์ (Collection)์ ๋ค๋ฃฐ ๋ ์๋นํ ํธ๋ฆฌํ๊ณ ๋ง๊ฐํฉ๋๋ค. ๋๋ถ๋ถ์ ์์ ์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํจ์๋ฅผ ํ์ฉํ ์ ์๊ณ , ๊ทธ๋ก ์ธํด ์ฝ๋๋ฅผ ์์ฃผ ๊ฐ๊ฒฐํ๊ฒ ๋ง๋ค ์ ์์ต๋๋ค. ๊ทธ๋ฌ๋ฏ๋ก ์ด๋ฒ์๋, ์ปฌ๋ ์ ์ ๋ค๋ฃจ๋ ์ฝํ๋ฆฐ ํ์ค ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ค์ ์ดํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค. ์ฐธ๊ณ ๋ก, ์ฝํ๋ฆฐ์์ ์ ๊ณตํ๋ ์ปฌ๋ ์ API๋ ์๋กญ๊ฒ ์ถ๊ฐ๋ ๊ฒ์ด ์๋, ๊ธฐ์กด์ java, C#, ๊ทธ๋ฃจ๋น, ์ค์นผ๋ผ ๋ฑ ๋๋ค๋ฅผ ์ง์ํ๋ ๋๋ถ๋ถ์ ์ธ์ด์์ ์ฌ์ฉํ๋ ๊ฒ๋ค๊ณผ ๋์ผํฉ๋๋ค. ํ์์ ์ธ ํจ์ : filter, map filter์ map์ ์ปฌ๋ ์ ์ ํ์ฉํ ๋ ๊ธฐ๋ฐ์ด ๋๋ ํจ์๋ก, ๋๋ถ๋ถ์ ์ปฌ๋ ์ ์ฐ์ฐ์ ์ด ๋ ํจ์๋ฅผ ํตํด ํํํ ์ ์์ต๋๋ค. filter filter ํจ์๋ ์ปฌ๋ ์ ์ iteration ํ๋ฉด์ ์ฃผ์ด์ง ๋๋ค์ ๊ฐ..
์ฑ ํจ์ค์๋ ๊ฒฐ๋ก ์ ์ผ๋ก, “๊ตฌ๊ธ๋ก ๋ก๊ทธ์ธ” ์ ํตํด ๋น๋ฒํท ๊ณ์ ์ ์์ฑํ์๊ณ , ์์ค๋ฅผ pull, push ํน์ clone ํ์ค ๋ ๊ถํ ์ค๋ฅ๊ฐ ๊ณ์ ๋ฐ์ํ์๋ ๋ถ๋ค์ App Password ๋ฅผ ์์ฑํ์ ์ ์ฌ์ฉํด๋ณด์ธ์. ๐ App password ์์ฑ ๋ฐฉ๋ฒ https://community.atlassian.com/t5/Bitbucket-questions/set-password-when-using-google-authentication/qaq-p/967729 ์ฐธ๊ณ https://ujeon.medium.com/bitbucket-%EA%B5%AC%EA%B8%80%EB%A1%9C-%EB%A1%9C%EA%B7%B8%EC%9D%B8-%ED%95%98%EC%85%A8%EB%8B%A4%EB%A9%B4-app-passwo..
//์ ๊ฑฐํ ์๋ก์ด SearchHistroyList storedSearchHistoryList.removeAt(index) Log.d(TAG, "Shared - ์ ๊ฑฐํ ์๋ก์ด list: $storedSearchHistoryList") // // K,V ํ์์ผ๋ก ์ ์ฅ๋์ด ์์ผ๋ ๋์ผํ K์ item์ด ํ๋ ์ญ์ ๋์ด ์ ๋ฐ์ดํธ๋ araryList๋ฅผ ๋ค์ ์ ์ฅ storeSearchHistoryList(storedSearchHistoryList) Log.d(TAG, "์ญ์ ํ listSize : ${storedSearchHistoryList?.size}") SharedPrefMgr์์ arrayList์์ ํด๋น index ๊ฐ์ ์ญ์ ํ๊ณ ์ถ์๋๋ฐ ๊ณ์ return๊ฐ๋ง ๋์์ ๋๋๋๋๋ฐ ์ด๋ฏธ ์ญ์ ํด์ ๊ทธ ์์ฒด๊ฐ ๋ณ๊ฒฝ๋ ..
TODO:: Adapter์์ ๋ฆฌ์ฌ์ดํด๋ฌ๋ทฐ ํ๋ํ๋ item ํด๋ฆญ → PhotoCollectionActivity๋ก ๊ฐ ์ป๊ธฐ ํ์์ฑ 1. ํด๋ฆญํ๊ณ ์ฒ๋ฆฌํ ์ผ๋ฐํจ์ or ๋๋คํจ์๋ฅผ ๋ฉ์ธ์ ์ถ๊ฐreturn ์์(๋ฐํx) ๊ฑ ํ ์คํธ SearchHistory๊ฐ์ ๊ฐ์ ธ์์ผํด์ ์์ฑ์์ ๋ฐ์ดํฐ ํด๋์ค SearchHistory๋ฅผ ๊ฐ๋๋ก ํจ. //ํด๋ฆญํด์ data๋ฅผ ์ป์ด์์ผํ๋ ์์ฑ์๋ก SearchHistory๋ฅผ ๋ฃ์ด์ค๋ค, ๊ธ๊ณ ํ ์คํธ๋ก ๋์์ ๋ฐ์ดํฐ ํ์ธ private fun listItemClicked(searchHistory: SearchHistory){ Toast.makeText(this, "PhotoCollectionActivity - listItemClicked()\n" + "term=> ${searchHis..
Lambda๋๋ค์(์๋ฐ8 ๋๋ค์ ์ง์) //๋ฉ์๋๊ฐ ํ๋์ธ ์ธํฐํ์ด์ค๋ SAM(Single Abstract Method)๋ณํ ๊ฐ๋ฅ button.setOnClickListener(object : View.OnClickListener{ override fun onClick(p0: View?) { // ํด๋ฆญ ์ด๋ฒคํธ } }) //SAM๋ณํ button.setOnClickListener { // ํด๋ฆญ ์ด๋ฒคํธ } SAM(Single Abstract Method) ๋ณํ //๊ธฐ๋ณธ fun sum(x: Int, y: Int): Int { return x + y } //{}์๋ต, return์๋ต fun sum(x: Int, y: Int) = x + y //๋ณ์๋ฅผ ํจ์์ฒ๋ผ ์ฌ์ฉ var add = { x: Int, y: Int..
๋ ํธ๋กํ ์ด์ฉํด์ ์ธ๋ถ API ํธ์ถํด์ ๋ฐ์ JsonData๋ฅผ ํ์ฑํด๋ณด์! call?.enqueue(object : retrofit2.Callback{ override fun onResponse(call: Call, response: Response) { when (response.code()){ 200 -> { Log.d(Constant.TAG, "RetrofitManager - ํต์ 200 ์ฑ๊ณต! \n" + "response: ${response.body()}") //jsonData์ฒ๋ฆฌ ๋ถ๋ถ // ํ์ฑ response.body()?.let{ responseBody -> val body = responseBody.asJsonObject val jsonArray = body.getAsJsonArray("..
Logging Interceptor ์ ์ฉ ์ RetrofitManager.searchPhotos(keyword, completion = { responseState, response -> when(responseState) { RESPONSE_STATE.OKAY -> { Toast.makeText(this, "ํธ์ถ์ฑ๊ณต!", Toast.LENGTH_SHORT).show() Log.d(TAG, "response OK! / reponseBody : $response") } RESPONSE_STATE.FAIL -> { Toast.makeText(this, "ํธ์ถ์คํจใ กใ ก", Toast.LENGTH_SHORT).show() Log.d(TAG, "response No! / t : $response") } } }) U..