Тёмный

How to Make HTTP Requests With Ktor-Client (Cooler Than Retrofit!) - Android Studio Tutorial 

Philipp Lackner
Подписаться 175 тыс.
Просмотров 69 тыс.
50% 1

Network requests with Ktor? Yes, that's possible! In this video you'll learn how.
⭐ Get certificates for your future job
⭐ Save countless hours of time
⭐ 100% money back guarantee for 30 days
⭐ Become a professional Android developer now:
pl-coding.com/premium-courses...
💻 Let me personally review your code and provide individual feedback, so it won't backfire and cost you a fortune in future:
elopage.com/s/philipplackner/...
Subscribe to my newsletter for regular Android, Kotlin & Architecture advice!
pl-coding.com/newsletter
Join this channel to get access to perks:
/ @philipplackner
Get the source code for this video here:
github.com/philipplackner/Kto...
Regular live codings on Twitch:
/ philipplackner
Join my Discord server:
/ discord
Regular programming advice on my Instagram page: / _philipplackner_
Checkout my GitHub: github.com/philipplackner
You like my free content? Here you can buy me a coffee:
www.buymeacoffee.com/philippl...

Опубликовано:

 

1 окт 2021

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 107   
@niranz7745
@niranz7745 2 года назад
Yes! I love Ktor videos. Can't wait for the KMM videos as well. Thank you Philipp
@kinggeorges625
@kinggeorges625 2 года назад
Thanks for the video and efforts you are putting to help people you don't even know. Stay blessed
@bertafitocasas7791
@bertafitocasas7791 Год назад
Hi! Thank you very much. You seem to have saved our project :)
@mattgraves3709
@mattgraves3709 2 года назад
I appreciate that we implement the interface with KTOR.
@sergeytarasov5041
@sergeytarasov5041 2 года назад
Phillip, you explain it so easy and good, I am very impressed, thank you.
@PhilippLackner
@PhilippLackner 2 года назад
Thank you!
@siva_subramaniam
@siva_subramaniam Год назад
Great content. Thanks Philipp.
@nonconsensualopinion
@nonconsensualopinion 2 года назад
Another great video. Thanks!
@vengateshm2122
@vengateshm2122 2 года назад
Hey Phillip last week I learnt ktor client for android and I thought you will put a video on that. Coo I predicted it. You are better teacher.
@islamhadjkaddour1532
@islamhadjkaddour1532 День назад
cool, where did you learn it from?
@azamovdev
@azamovdev Год назад
I have been using Retrofit2 for a long time, after this video I realized that ktor is very light and easy, thank you very much
@truongxuan8322d
@truongxuan8322d Год назад
can you give me the names of youtube channels to learn how to build resfull api + kotlin retrofit?
@Another0neTime
@Another0neTime 2 года назад
Great work! Bravo.
@slayer5171
@slayer5171 2 года назад
This is impressive, thanks for sharing.
@mattgraves3709
@mattgraves3709 2 года назад
Great Video! Thanks Phillipp
@PhilippLackner
@PhilippLackner 2 года назад
Thanks for watching!
@jatinvashisht4293
@jatinvashisht4293 2 года назад
Thumbnail is lit 🔥
@user-uu8rn6wf4u
@user-uu8rn6wf4u Год назад
Thank you Philipp!
@SuessesSumpfhuhn
@SuessesSumpfhuhn 2 месяца назад
Hey Philipp, thanks for this amazing video! I'd need to know how to send more complex client requests with parameters and basic authentication details to the server. Could you maybe do a second video on this?
@richardwilkinson7873
@richardwilkinson7873 2 года назад
Once again awesome video :) Is there another video to explain how to consolidate input fields into json and POST??
@alij3fer
@alij3fer 2 года назад
🔥😍 Thanks bro
@madalitsophiri3728
@madalitsophiri3728 2 года назад
finally a good tutorial on ktor
@shanahjrsuping7344
@shanahjrsuping7344 2 года назад
Hi Phillip, thank you so much for the video. It has opened my eyes quite a a bit as I would like to get into native app development. My question is, would it be possible to use generics for the post service so that the code doesn't need to be copied and pasted so many times?
@khanzadakashif8248
@khanzadakashif8248 2 года назад
I can't decide what's more creative, Your videos or your thumbnails...😆
@nabazbarzanji3221
@nabazbarzanji3221 2 года назад
That's awesome💯
@marlonlom
@marlonlom Год назад
Hi Phillip, thank you so much for the video. wanna ask about unit testing ktor client and spi implementation using mocks, the json examples and its usang in unit and integratin tests :)
@raheemadamboev
@raheemadamboev 2 года назад
Hey Philipp! Could you make a tutorial about creating your own android library and publishing with the help of jitpack in gradle 7.0 please
@sebastianpalm3495
@sebastianpalm3495 10 месяцев назад
Great video as always I have one question how do you configure the client to accept self signed certificates?
@CarlosSilva-mm8py
@CarlosSilva-mm8py 2 года назад
Hi Phillip, could you record a video about MVVM + Clean Architecture + FirebaseAuth / FirebaseRealTimeDataBase, I have many doubts about this and I believe it will help not only me but others as well. Great video.😆😆😆
@user-kd4gl9rf5k
@user-kd4gl9rf5k 2 года назад
Real-time database is not used anymore. Firestore is the better option
@nicolasdev7220
@nicolasdev7220 2 года назад
@@user-kd4gl9rf5k why? which is the most used now?
@coldwolf5050
@coldwolf5050 2 года назад
Good video, did not know ktor can be used in Android as well.
@rivaldohadiwinata6803
@rivaldohadiwinata6803 Год назад
very helpful !
@fnax
@fnax 2 года назад
Very good video and library! Can it be used for xml apis ?
@ashutoshandhare7626
@ashutoshandhare7626 2 года назад
Hey, how do we use the create post function? Like I've been searching for a whole day now on how to send a post request, but none have shown the way to call the post function from the main_activity.kt file. We created the functions and implementations for post request, but how do we really call that from the main function?
@re_allyedge
@re_allyedge 2 года назад
Hey Philipp! Could you make a tutorial about Authentication using both Ktor server and Ktor client?
@vengateshm2122
@vengateshm2122 2 года назад
Yes there are several authentication. We can start with basic and jwt.
@vyas8137
@vyas8137 2 года назад
@@vengateshm2122 bro could you suggest me some good android development resources?
@vengateshm2122
@vengateshm2122 2 года назад
@@vyas8137 Phillip lackner Simplified coding Coding in flow Rahul Pandey Slidenerd Android developers documentation, especially code labs.
@vyas8137
@vyas8137 2 года назад
@@vengateshm2122 bro could you please provide the links for beginners I just know basic kotlin so what all I should look for as the android development domain is always changing.
@vengateshm2122
@vengateshm2122 2 года назад
@@vyas8137 Start with recycler view, activity, fragment, camera, services, content provider. MVP concepts then mvvm
@RoniTadmor
@RoniTadmor Год назад
Great video :) any chance for an update for varsion 2... ?
@Ceisluck
@Ceisluck 2 года назад
Did you mesaure the eficency of this change in terms of speed/size etc or this is another random video in youtube?
@ekhiw
@ekhiw 2 года назад
How to make stream data for download large file using ktor? Or make a multipart post request for upload large file?
@Coldalecs
@Coldalecs 9 месяцев назад
Very good info! But this is already outdated, for example instead of `install(JsonFeature)` you now have `install(ContentNegotiation){json()}`. Good work, Philipp!
@allanaraujo2157
@allanaraujo2157 5 месяцев назад
thank you
@allanaraujo2157
@allanaraujo2157 5 месяцев назад
install(ContentNegotiation) { json(Json { isLenient = true; ignoreUnknownKeys = true }) }
@PritamDas-rj5fk
@PritamDas-rj5fk 2 года назад
after update the ktor to 2.0 its show error in clint.get mismatch help??
@TheZukkino
@TheZukkino Год назад
You might do an update for v 2.x.x cause of many plugin changes.
@emmanuelmtera5936
@emmanuelmtera5936 2 года назад
Hello Philip followed the video in all steps but suddenly i always get 400 error , what step might have i gone wrong? is it the data class maybe or ? versions? Thanks in advance.
@sebastianpalm3495
@sebastianpalm3495 10 месяцев назад
Is a really good video sadly a bit outdated because of the changes in Ktor any plans to do another one in the future?
@fensom80
@fensom80 Год назад
Okay, so to put it all together, Kotlin Multiplatform using clean architecture and MVI using Ktor? to call a NodeJS Graphql server UI will be Jetpack Compose for Android and SwiftUI for Apple products. Can you please make this video or better option. Please? Thankyou!!!!!
@storypur
@storypur 2 года назад
Is ktor good for making large-scale android applications?
@user-kq8yo1qu7m
@user-kq8yo1qu7m 2 года назад
Great!!!
@muhammadhassaansiddiqi8586
@muhammadhassaansiddiqi8586 2 года назад
please make video for c.Arci + KTOR with Full Error handling. both get and post apis. please di how we use in ktor
@sanjaybhatikar
@sanjaybhatikar 11 месяцев назад
Cool! How to make an OAuth call and stash a JWT token to send with requests? Cheers!
@youprimeprime3046
@youprimeprime3046 2 года назад
can you make more videos related to ktor stuff thanks
@myrzabekylychev5112
@myrzabekylychev5112 2 года назад
Nice! Thank you! Can you provide video with uploading image to server using multipart form data, please?
@vengateshm2122
@vengateshm2122 2 года назад
Hey I would suggest follow ktor doc. I know Phillip videos are awesome but if you don't try to understand on your own you will end up searching for tutorials all time. Phillip is investing his valuable time to provide quality content. Hope he will cover the topic also that you want. Meanwhile You can look into the docs and give a try. If you did then go ahead and write an article in medium or dev.to what you learnt. You will feel confident b that time.
@devOmarAZ
@devOmarAZ 2 года назад
really what is the difference between java serializable and kotlin serializable ? and kotlin serializable vs parcelable? java serializable vs kotlin serializable vs parcelable ?
@PritamDas-rj5fk
@PritamDas-rj5fk 2 года назад
can i create a data class with only my nessary variable like can i create data class without body and user id
@MtaufiqH731
@MtaufiqH731 2 года назад
So we use ProduceState is a trick to make an app without viewmodel.? So the data still dynamic and the state is not change if we rotate the phone.?
@PhilippLackner
@PhilippLackner 2 года назад
No don't get this wrong. I just don't used a viewmodel here because the focus is on ktor. Just to get an understanding of how the ktor library works
@priyaranjanmantri9332
@priyaranjanmantri9332 2 года назад
Hey it's awesome...
@japneetraina8146
@japneetraina8146 Год назад
ha shilli waa philipp lakdi walli
@veygard
@veygard 2 года назад
ty for video
@SaherAlSous-welcomes-you
@SaherAlSous-welcomes-you 2 года назад
thank you
@gorkemozgur6796
@gorkemozgur6796 2 года назад
I wonder how you can do interceptor like okhttp client
@aabhishek4911
@aabhishek4911 2 года назад
Btw retrofit can be used for any java/kotlin project , not just android
@PhilippLackner
@PhilippLackner 2 года назад
Yep but not kmm
@RoKotEyn
@RoKotEyn Год назад
But how do I refresh it with click of a button, though?
@Muhfara
@Muhfara 2 года назад
please make a coin tutorial and your feedback about coins compared to dagger hilt
@vedx
@vedx 2 года назад
Cool 😘
@ymusclecode
@ymusclecode 2 года назад
I have 2 emulators, on android 11 does not work, on android 8 works as expected
@quantumgaming7
@quantumgaming7 2 года назад
Retrofit still wins 💕💕
@irfanirawansukirman4809
@irfanirawansukirman4809 2 года назад
Hi Phillip, how to use Chuck/Chucker using Ktor? thanks
@andikitta9480
@andikitta9480 Год назад
Did you find that?
@abhijith_mogaveera
@abhijith_mogaveera 2 года назад
That means, can we can also use this for interactions with Socket..?
@PhilippLackner
@PhilippLackner 2 года назад
yes
@vyas8137
@vyas8137 2 года назад
Hey man! Could you suggest some good resources to learn Android development from beginners to advanced , Cause I tried numerous resources most of them are outdated and some don't work properly.
@cleancodez
@cleancodez 2 года назад
i think is here, i learnt from him since my start, and now i can make apps through his knowledge, Philip this is great. i also have some conted though my audio is not good, you can check if they might be of help to you. Just click my profile. but remember, Philip has almost what you need to get started as a pro dev
@vyas8137
@vyas8137 2 года назад
@@cleancodez will check, thanks mate : )
@ChristiaanHunter
@ChristiaanHunter 4 месяца назад
hi Mr Lackner, i am still learning but a bit confused with the build.grade.kts, my file looks like this dependencies { implementation(libs.androidx.core.ktx)... your gitHud looks like this dependencies { implementation 'androidx.core:core-ktx:1.6.0'.... I guessing this is a different language format to set the dependencies ? thanks for your vids
@Somerandomnessvvv
@Somerandomnessvvv 2 года назад
Is this also applicable when using ktor websockets?
@PhilippLackner
@PhilippLackner 2 года назад
Yes
@alleaffen1926
@alleaffen1926 Год назад
Hello, I need to use a get-request to get the bearer token and then use this token for another get-request where for the profile-informations. Is this possible with Ktor? I am relatively new on this programming things, so maybe someone could give me some hint/s.. Thanks in advance. And thanks for this clear tutorial, it helped me a lot :)
@vinayparmar7361
@vinayparmar7361 Год назад
hey, I am at the situation where you were month ago.. I am having the concern.. can you please recommend the way if you have found the solution?
@alleaffen1926
@alleaffen1926 Год назад
@@vinayparmar7361 sorry, no not yet.. Hadn't much time to try it. Did you success in the meantime?
@alleaffen1926
@alleaffen1926 Год назад
@@vinayparmar7361 I think the solution is saving the received token with shared preferences and then add the token with the @Header annotation..
@TheZaurHasanov
@TheZaurHasanov Месяц назад
​ @vinayparmar7361 did you guys find the way?
@BearkFearGamer
@BearkFearGamer 2 года назад
Better than retrofit!
@subyk6046
@subyk6046 10 месяцев назад
13:35 isnt better wrap result in repository? In repository I call api.getPost function who will return Result and in VW i can handle onSuccess and onFailure. Btw thanks a lot for the video. :)
@mehranj73
@mehranj73 2 года назад
I think Ktor-Client is also suitable for compose desktop.
@PhilippLackner
@PhilippLackner 2 года назад
Sure since it's a kotlin library
@maskedredstonerproz
@maskedredstonerproz 2 года назад
Speaking of compose desktop, Philipp are you ever gonna take a look at that and show us a few things about it???
@mehranj73
@mehranj73 2 года назад
@@maskedredstonerproz too soon
@maskedredstonerproz
@maskedredstonerproz 2 года назад
@@mehranj73 what do you mean too soon??
@mehranj73
@mehranj73 2 года назад
@@maskedredstonerproz It is not production ready and you can also try it in IntelliJ. Compose desktop in still jetpack compose.
@pritamdas1156
@pritamdas1156 2 года назад
how to make request with Credentials
@thkorkem
@thkorkem 2 года назад
Nice video. However, Retrofit is much simpler and useful than that.
@PhilippLackner
@PhilippLackner 2 года назад
It depends
@suneelkumar-hm4kd
@suneelkumar-hm4kd 2 года назад
10:31
@mohamadrezazandieh3003
@mohamadrezazandieh3003 8 месяцев назад
awli bood haji
@mrwhoknows
@mrwhoknows 2 года назад
0th
@TreudtLP
@TreudtLP Год назад
Mega scheiße das Video, absoluter Müll die Hälfte des Screens nicht einzublenden
@Joe-pz4ss
@Joe-pz4ss Год назад
I am getting an Unresolved reference: JsonFeature error. I found one stackoverflow post but it didn't fix my issue. I have the following dependencies: def ktor_version = "2.2.2" implementation "io.ktor:ktor-client-core:$ktor_version" implementation "io.ktor:ktor-client-android:$ktor_version" implementation("io.ktor:ktor-client-apache:$ktor_version") implementation("io.ktor:ktor-client-json:$ktor_version") implementation "io.ktor:ktor-client-serialization:$ktor_version" implementation "io.ktor:ktor-client-logging:$ktor_version" implementation "ch.qos.logback:logback-classic:1.4.5" implementation("io.ktor:ktor-client-content-negotiation:$ktor_version") implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0"
@flychee123
@flychee123 Год назад
works for me with the same dependencies but 2.2.3 and the following code instead of the JsonFeature: install(ContentNegotiation){ json(Json{ prettyPrint = true isLenient = true }) }
Далее
How to Make Your Code Clean With Kotlin Sealed Classes
18:09
Beautiful sport😍
00:20
Просмотров 309 тыс.
Разбудили Любимой Песней 😂
00:14
They got a Golden Buzzer 🤣✨
00:46
Просмотров 13 млн
БАССЕЙНЫ ПО ЦВЕТАМ ЧЕЛЛЕНДЖ !
38:20
Implement a REST API with KTOR and JWT access tokens
1:03:40
6 Design Patterns Every Android Developer Must Know
14:16
Build APIs with Ktor and Kotlin
9:30
Просмотров 31 тыс.
Make Your Code Clean With the SOLID Principles
18:24
Просмотров 96 тыс.
Beautiful sport😍
00:20
Просмотров 309 тыс.