๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ

(377)
[Android][Retrofit][OAuth] OAuth2.0 ์ธ์ฆ ์ฒ˜๋ฆฌ๋กœ ๋ณ€๊ฒฝ ์„œ๋ฒ„์—์„œ OAuth2.0 ์ธ์ฆ ๋„์ž…์œผ๋กœ ์•ˆ๋“œ๋กœ์ด๋“œ ์•ฑ์˜ ์‚ฌ์ธ์ธ ๋ฐ api ํ†ต์‹  ๋ฐ ์—๋Ÿฌ์ฒ˜๋ฆฌ์— ์ˆ˜์ • ์‚ฌํ•ญ์ด ์ƒ๊ฒผ๋‹ค. OAuth2.0 https://oauth.net/2/ ** OAuth2.0 ๋ฌธ์„œ๋ฅผ ์ฝ๊ณ  ์ถ”๊ฐ€ํ•  ์˜ˆ์ • Retrofit ์—์„œ์˜ ์ฒ˜๋ฆฌ API ํ†ต์‹  ์‹œ, Access Token์„ Header์— ๋„ฃ์–ด์ฃผ๊ณ  ์žˆ๊ณ , ์ด ์ฒ˜๋ฆฌ๋Š” OkHttp์˜ interceptor๋ฅผ ์‚ฌ์šฉํ•ด ์ฒ˜๋ฆฌํ•œ๋‹ค. ์‚ฌ์ธ์ธ ํ•˜๋ฉด์„œ ๋ฐ›๋Š” ํ† ํฐ ์ •๋ณด์— ํ† ํฐ์˜ ์œ ํšจ ๊ธฐ๊ฐ„ ์ •๋ณด๋„ ์•Œ๋ ค์ฃผ๋‚˜, ์ด๋ฅผ ํ™œ์šฉํ•˜๊ธฐ ๋ณด๋‹ค๋Š” API ํ†ต์‹  ์‹œ์— ๋ฐ›๋Š” access token ๋งŒ๋ฃŒ ์—๋Ÿฌ์ฝ”๋“œ๋ฅผ ๋ฐ›์•„ access token์„ ๊ฐฑ์‹  ํ›„ ๋‹ค์‹œ ํ•ด๋‹น API ํ†ต์‹ ์„ ์ง„ํ–‰ํ•˜๋Š” ๋ฐฉ๋ฒ•์œผ๋กœ ๊ตฌํ˜„ํ•˜๊ธฐ๋กœ ํ–ˆ๋‹ค. OkHttpClient์— addํ•˜๋Š” ๊ธฐ์กด interceptor๋Š” ํ—ค๋”์— acc..
[Android] androidx.fragment.app.FragmentContainerView https://developer.android.com/reference/androidx/fragment/app/FragmentContainerView FragmentContainerView | Android Developers androidx.car.app.managers developer.android.com ํŠน๋ณ„ํžˆ Fragment๋ฅผ ์œ„ํ•ด ์ปค์Šคํ…€๋œ Layout. FrameLayout์„ ์ƒ์†๋ฐ›์Œ Fragment Transaction ์ฒ˜๋ฆฌ๊ฐ€ ์•ˆ์ •์  Fragment ๋™์ž‘์„ ์กฐ์ •ํ•˜๋Š” ์ถ”๊ฐ€์ ์ธ ๊ธฐ๋Šฅ ์ œ๊ณต ์ผ๋ฐ˜์ ์œผ๋กœ Activity์˜ xml layout์—์„œ, Fragment ์ปจํ…Œ์ด๋„ˆ๋กœ์„œ ์‚ฌ์šฉ๋˜์–ด์•ผ ํ•œ๋‹ค. android:name ์†์„ฑ์„ ์ด์šฉํ•ด Fragment๋ฅผ ์ถ”๊ฐ€ํ•  ์ˆ˜ ์žˆ๋‹ค. ๋‹ค์Œ์˜ ์ผํšŒ์„ฑ ์ž‘์—…์„ ์ง„ํ–‰ํ•œ๋‹ค. 1...
[Android] API vs SKD ์ฐจ์ด https://www.youtube.com/watch?v=kG-fLp9BTRo API Application Programming Interface 1. ํ†ต์‹ ์„ ๋ชฉ์ ์œผ๋กœ ํ•œ๋‹ค. 2. ์ถ”์ƒํ™”๋˜์–ด ์žˆ๋‹ค. - ๋ณต์žกํ•œ ๋…ผ๋ฆฌ๋ฅผ ์ถ”์ƒํ™” ์‹œ์ผœ ๊ฐ„๋‹จํ•˜๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•จ 3. ํ‘œ์ค€ํ™”๋˜์–ด ์žˆ๋‹ค. - ex) SOAP, REST ๋“ฑ ๊ตฌ์„ฑ์š”์†Œ Request OPERATION - GET, POST, PUT, DELETE PARAMETER ENDPOINT Response json ๊ฐ™์€ ์›์‹œ๋ฐ์ดํ„ฐ API๋ฅผ ์‹ค์ œ๋กœ ํ˜ธ์ถœํ•˜๊ธฐ > SDK ๋“ฑ์žฅ! SDK Software Development Kit ๋„๊ตฌ(tool)์˜ ๋„๊ตฌ์ƒ์ž. ํ˜น์€ API๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๋„๊ตฌ์ƒ์ž ์ง€์›์–ธ์–ด - Java, Go, Python ๋“ฑ ๋‹ค์–‘ ์š”์•ฝ API : ๋‹ค๋ฅธ ์‹œ์Šคํ…œ์˜..
[Android] ๋„คํŠธ์›Œํฌ ์ž‘์—… ์ค‘ ๊ฐ„ํ—์  java.io.IOException: unexpected end of stream on https://juntcom.tistory.com/105 [okhttp3] okhttp IOException: unexpected end of stream on Address ์Šคํ”„๋ง์—์„œ okhttp3 ๋ฅผ ์‚ฌ์šฉ์ค‘ ๋กœ๊ทธ์— ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๊ฐ€ ๋–ด๋‹ค. okhttp3 ์‚ฌ์šฉ ์ค‘์— ๊ฐ„ํ—์ ์œผ๋กœ unexpected end of stream on [์ฃผ์†Œ] ๊ฐ€ ๋‚˜์™”๋‹ค. request ๋ฅผ ์š”์ฒญ๋ฐ›๋Š” ์„œ๋ฒ„ ์„ค์ •๋งˆ๋‹ค ๋‹ค๋ฅธ ๊ฒƒ ๊ฐ™๋‹ค. ํ•ด๋‹น juntcom.tistory.com Request.Builder์— addHeader("Connection", "close") ์ถ”๊ฐ€ ํ›„ ๋ฌธ์ œ ํ•ด๊ฒฐ๋จ.
[Android] deprecated AsyncTask ์ˆ˜์ • > Executors ์ด์šฉํ•˜๊ธฐ https://ittutorialpoint.com/the-asynctask-api-is-deprecated-in-android-11-what-are-the-alternatives/?quad_cc The AsyncTask API is deprecated in Android 11. What are the alternatives? You can directly use Executors from java.util.concurrent package.I also searched about it and I found a solution in this Android Async API is ittutorialpoint.com Solution 2 ๋ฐฉ๋ฒ•์„ ์ด์šฉํ–ˆ์Œ. ExecutorService executor = Execu..
[Android] deprecated AsyncTask ์ˆ˜์ • > RxJava ์ด์šฉํ•˜๊ธฐ https://androidsrc.net/replace-android-asynctask-rxjava/ Replace Android AsyncTask with RxJava - AndroidSRC Today is the day when we will say goodbye to AsyncTask. It will be replaced by our new friend RxJava which is quite in news now a days. We will be covering how RxJava... androidsrc.net Observable.just(input) .map(this::doInBackground) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedul..
[Android] startActivity()๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ์•ˆ๋“œ๋กœ์ด๋“œ ์‹œ์Šคํ…œ์—์„œ๋Š” ์–ด๋–ป๊ฒŒ Activity๋ฅผ ์‹คํ–‰ํ•˜๋Š”๊ฐ€ 1 manifest ํŒŒ์ผ์— ์š”์†Œ๋ฅผ ์š”์†Œ์˜ ํ•˜์œ„ ์š”์†Œ๋กœ ์ถ”๊ฐ€ํ•ด์•ผํ•œ๋‹ค. ์—ฌ๊ธฐ์— ์„ ์–ธ๋˜์ง€ ์•Š์€ activity ์™ธ ๋‹ค๋ฅธ ๊ตฌ์„ฑ์š”์†Œ๋“ค์€ ์‹œ์Šคํ…œ์—์„œ ์‹คํ–‰ํ•  ์ˆ˜๊ฐ€ ์—†๋‹ค. 2 startActivity()์˜ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ๋“ค์–ด๊ฐ€๋Š” Intent๋Š” ์‹œ์ž‘ํ•  ์•กํ‹ฐ๋น„ํ‹ฐ๋ฅผ ์„ค๋ช…ํ•˜๊ณ  ๋ชจ๋“  ํ•„์ˆ˜ ๋ฐ์ดํ„ฐ๋ฅผ ๋‹ด๋Š”๋‹ค. 3 - 1 Intent ๊ฐ์ฒด๊ฐ€ ํŠน์ • ์•กํ‹ฐ๋น„ํ‹ฐ๋ฅผ ๋ช…์‹œ์ ์œผ๋กœ ์ง€์ •ํ•  ๊ฒฝ์šฐ. ์•ฑ์˜ ํŒจํ‚ค์ง€ ์ด๋ฆ„ ๋˜๋Š” ๊ตฌ์„ฑ ์š”์†Œ ํด๋ž˜์Šค ์ด๋ฆ„ ์ •๋ณด๋ฅผ ๋„ฃ์Œ : ๋ช…์‹œ์  ์ธํ…ํŠธ. ์ผ๋ฐ˜์ ์œผ๋กœ ์•ฑ ์•ˆ์—์„œ ๊ตฌ์„ฑ์š”์†Œ๋ฅผ ์‹คํ–‰ํ•  ๋•Œ(๋ถ€๋ฅผ ๋•Œ... ๊ฐ€ ๋งž์„ ์ˆ˜๋„) ๋ช…์‹œ์  ์ธํ…ํŠธ๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค. > Intent ๊ฐ์ฒด๊ฐ€ ๋ช…์‹œ์ ์œผ๋กœ ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ์ง€์ •ํ•˜๋ฉด ์‹œ์Šคํ…œ์ด ํ•ด๋‹น ๊ตฌ์„ฑ ์š”์†Œ๋ฅผ ์ฆ‰์‹œ ์‹œ์ž‘ํ•œ๋‹ค. 3 - 2 Intent ๊ฐ์ฒด๊ฐ€ ์ˆ˜ํ–‰ํ•  ์ผ๋ฐ˜์ ์ธ ์ž‘์—…์„ ์„ ์–ธํ•  ๊ฒฝ์šฐ : ์•”์‹œ์  ์ธํ…ํŠธ..
[Android][Firebase]FIS_AUTH_ERROR FirebaseInstanceId๋ฅผ ํ†ตํ•ด FCM ํ† ํฐ์„ ๋ฐœ๊ธ‰๋ฐ›๋˜ ์ฝ”๋“œ๋ฅผ FirebaseMessaging์„ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๋ฐ”๊พธ์—ˆ๋Š”๋ฐ ์ด์Šˆ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. ์ด์Šˆ ๋ถ„์„ FirebaseMessaging ์„ ํ†ตํ•ด FCM ํ† ํฐ ํ˜ธ์ถœ ์‹œ ๊ฐ„ํ—์ ์œผ๋กœ RuntimeExecutionException ๋ฐœ์ƒํ•œ๋‹ค. ๊ฐ„ํ—์ ์œผ๋กœ ๋ฐœ์ƒํ•˜๋Š” ์ด์œ ๋Š”, ๋„คํŠธ์›Œํฌ ์—ฐ๊ฒฐ์— ๋ฌธ์ œ๊ฐ€ ์žˆ์„ ๊ฒฝ์šฐ์— ํ•ด๋‹น ์ด์Šˆ๊ฐ€ ๋ฐœ์ƒํ•œ๋‹ค๋Š” ๊ฒƒ์„ ํ…Œ์ŠคํŠธ๋ฅผ ํ†ตํ•ด ๋ฐœ๊ฒฌํ–ˆ๋‹ค. FIS_AUTH_ERROR ๋กœ ์—๋Ÿฌ ๋ฉ”์‹œ์ง€๊ฐ€ ๋…ธ์ถœ๋œ๋‹ค. FIS ๋Š” Firebase Installations Service๋กœ, Firebase ์„œ๋น„์Šค๋“ค(์˜ˆ : Firebase ํด๋ผ์šฐ๋“œ ๋ฉ”์‹œ์ง•, Firebase์šฉ Google ์• ๋„๋ฆฌํ‹ฑ์Šค ๋“ฑ)์— ๋‚ด๋ถ€์ ์œผ๋กœ ์‚ฌ์šฉ๋˜๋Š” Firebase ์„ค์น˜ ID๋ฅผ ์ œ๊ณตํ•œ๋‹ค. FI..