How to Build a Clean Architecture GraphQL App With Kotlin - Android Studio Tutorial

  Рет қаралды 37,813

Philipp Lackner

Philipp Lackner

Күн бұрын

With GraphQL you can define what data you want to get from an API to avoid getting a lot of fields you don't need. This optimizes your network traffic and battery consumption for your app. In this video, you'll learn how you can make use of this in Android.
⭐ FEBRUARY SALE: Get 20% discount on ALL my courses with FEBRUARY20:
ttps://pl-coding.com/premium-courses?
Get to the countries API here:
studio.apollog...
Get the initial source code for this video here:
github.com/phi...
Get the final source code for this video here:
github.com/phi...
Regular programming advice on my Instagram page: / _philipplackner_
Checkout my GitHub: github.com/phi...

Пікірлер: 97
@elohimalves
@elohimalves Жыл бұрын
You're not from this world! You're so helpful with your videos! ❤️
@PhilippLackner
@PhilippLackner Жыл бұрын
Thank you🙌❤️
@nastenkaoo
@nastenkaoo Жыл бұрын
danke mein mann
@levp1801
@levp1801 Жыл бұрын
@@PhilippLackner What is the full command here? 9:40
@danielayodeji3641
@danielayodeji3641 Жыл бұрын
I await for this. Thank you for all what you do for the Android community.
@anb4351
@anb4351 Жыл бұрын
at ~ 9:20 we can never completely see the terminal ./gradlew command you exucuted because of your face blocking the view you should paste it in description and also explain better / in more details on how it works
@ryallnovember2664
@ryallnovember2664 Жыл бұрын
At 09:40 his face cam covers the url. here is the full command --> ./gradlew :app:downloadApolloSchema --endpoint='paste-apollo-url-here' --schema=app/src/main/graphql/schema.graphqls
@moahmedabdelhakimhacine7317
@moahmedabdelhakimhacine7317 9 ай бұрын
android community are the best ,, than broooooo
@akshayth4662
@akshayth4662 9 ай бұрын
The only useful comment
@gofudgeyourselves9024
@gofudgeyourselves9024 7 ай бұрын
Thank you
@somaiadamlakhi4079
@somaiadamlakhi4079 19 күн бұрын
You are amazing man , you have a great effect in my work experience as an Android developer , keep going !
@Nick-cx4rs
@Nick-cx4rs Жыл бұрын
Bro since i started android i see you more than my family :)
@Abelmengesha-sp6lv
@Abelmengesha-sp6lv Жыл бұрын
39:50 you clicked my country there! Love and respect from countries[39:50] Philip!
@markusmcgee
@markusmcgee Жыл бұрын
Good explanation of not just GraphQL but on JetPack state and Hilt. I need to tighten up how I use JetPack state based on your video. Extremely good job.
@PhilippLackner
@PhilippLackner Жыл бұрын
Thanks 🙌🙌
@AmitJayant
@AmitJayant Жыл бұрын
I like how your t shirt changed magically at 1:33
@hellodevs
@hellodevs Жыл бұрын
Thank you for always showing amazing content 🇧🇷🇧🇷🇧🇷
@frankleth9380
@frankleth9380 Жыл бұрын
Congratulation 100.000 Follower, cool
@flowzk921
@flowzk921 Жыл бұрын
Another MasterClass from Philipp! Many Thanks!!!
@osisuper98
@osisuper98 Жыл бұрын
Always learning from you Philipp.
@tonnie7079
@tonnie7079 Жыл бұрын
I learnt a new trick today: _state.update { it.copy()} is dope. Before I was doing _state.value = _state.value.copy() which is feels repetitive . You are a Legend!
@theophilus494
@theophilus494 Жыл бұрын
You ve just blown my mind with this.. thanks boss
@RahulKumar-un6ur
@RahulKumar-un6ur Жыл бұрын
Fantastic and crystal clear explanation. Thank you very much 🙏.
@mithileshdhupia2533
@mithileshdhupia2533 Жыл бұрын
I was waiting for this for so long... Finally...
@burakkaraduman6394
@burakkaraduman6394 Жыл бұрын
It's a great video. There aren't many videos about this thank you. Why did we create country classes when we already have the opportunity to create custom queries in GraphQL?
@user-dn1ep2kb4o
@user-dn1ep2kb4o Жыл бұрын
Thank you so much for interesting topics. Please don't stop to do some non-standart stuff sometimes
@bestoftheinternet3421
@bestoftheinternet3421 Жыл бұрын
Thanks for putting out content on complex topics
@gugapadilha6945
@gugapadilha6945 Жыл бұрын
Going for the 100k! congrats dude you deserve the best :)
@PhilippLackner
@PhilippLackner Жыл бұрын
🙌🙌❤️
@gugapadilha6945
@gugapadilha6945 Жыл бұрын
​@@PhilippLackner btw do you mind to send me the full path that you write on terminal in 9:19? your webcam got in front of it hehe
@jefissuu
@jefissuu Жыл бұрын
Thanks, Philipp, for amazing content 🇧🇷
@celik_m
@celik_m 8 күн бұрын
Nice explanation, tnx!
@AmitVerma-iq3oe
@AmitVerma-iq3oe 8 ай бұрын
Thanks for making such a video, It helps a lot, keep it up 👏
@sonamyadav0333
@sonamyadav0333 Жыл бұрын
Thanks Phillip for the great work. Great tutorial with great explanation. Appreciate that you take time explaining things in details. Great job. Thank you.
@sh3r1p49
@sh3r1p49 Жыл бұрын
Thank you so much Philipp! This helps me a lot! :)
@rileyfarro6801
@rileyfarro6801 Жыл бұрын
Great video! I can sense that your new premium course might be about creating a ktor backend with grapql then KMM or just android 😁
@PhilippLackner
@PhilippLackner Жыл бұрын
Actually not, I think GraphQL is a bit too niche for that 😁
@SiamakAshrafi
@SiamakAshrafi Жыл бұрын
LOL ... just finished my multi-module clean arch Android GraphQL project ... Needed this a week ago 🙂
@SiamakAshrafi
@SiamakAshrafi Жыл бұрын
If you turn on Apollo cache you get a Flow and it looks more like the RoomDB
@miansarimhameed6248
@miansarimhameed6248 Жыл бұрын
Amazing tutorial ♥
@dzartxstudio
@dzartxstudio Жыл бұрын
Love it ❤️ From Algeria
@farouksabiou
@farouksabiou 8 ай бұрын
Thank you Philipp 👏
@user-lw5ox7mg2o
@user-lw5ox7mg2o Жыл бұрын
Thank you so much for your work! It's really nice content. Few tips if you don't mind: - You could provide only ApolloClient in your Dagger Module and use @Binds for map CountryClient to ApolloCountryClient. So you can use just constructor @Inject for UseCases. - Why did you create CountryClient in domain package? It seems that it should be in data layer too. At your solution data layer knows about domain layer but is not good and it is break Clean Architecture approach. But anyway it was nice video, thanks!
@PhilippLackner
@PhilippLackner Жыл бұрын
Seems like you misunderstood something about CA then, domain is the innermost layer and is allowed to be accessed by all other layers (which is the reason CountryClient has to be in domain). So domain shouldn't know about data, but both presentation and data can access domain
@user-lw5ox7mg2o
@user-lw5ox7mg2o Жыл бұрын
@@PhilippLackner ok, maybe I missed it. Thanks.
@jayantkumar1954
@jayantkumar1954 Жыл бұрын
Wow amazing 😍❤️
@mrdeveloper4438
@mrdeveloper4438 Жыл бұрын
Nice one phillip...
@yasserakbbach708
@yasserakbbach708 Жыл бұрын
22:21 this made my day about use cases :V
@jayshartzer844
@jayshartzer844 Жыл бұрын
Awesome! I use GraphQl and this tutorial helps with the Apollo client (currently manual creation of DTOs due to lower min SDK). Getting closer to touching every aspect of Android development! OpenID/OAuth 2 integration soon?
@elzubairelseddeg4047
@elzubairelseddeg4047 Жыл бұрын
Hello sir First, thanks for your great channel Secondly, can you make a video on how to build a small application from within which you only download the details of the application or features that you want? Thanks again
@elangovankr110
@elangovankr110 Жыл бұрын
Very interesting topics ❤
@JuanDanielOrnella
@JuanDanielOrnella Жыл бұрын
Amazing bro!
@ramanpreetkaur5751
@ramanpreetkaur5751 5 ай бұрын
Hi, Great Philipp, but could you please explain how to do it without use cases, can i directly access countryClient in viewModel?
@bohdanserdyuk5959
@bohdanserdyuk5959 Жыл бұрын
Many thanks for your work, Philipp! Would be great to have masterclass from you of working with content provider(for both cases of collecting and sharing data by app)
@umnikya7874
@umnikya7874 Жыл бұрын
Cool! I started from initial project and finish it! All works! Great! 🙂
@levp1801
@levp1801 Жыл бұрын
What is the full command here? 9:40
@aldiguizot
@aldiguizot Жыл бұрын
Still waiting the full command
@levp1801
@levp1801 Жыл бұрын
@@aldiguizot i actually never seen him fixing his mistakes in comments :(
@Shamil_gulmetov
@Shamil_gulmetov Жыл бұрын
Kick when they say please
@McMouse88
@McMouse88 11 ай бұрын
Thank Philipp, create another one about gRPC, please
@samdroid37
@samdroid37 Жыл бұрын
you absolutely rule
@Tuligarnio
@Tuligarnio Жыл бұрын
What's the difference between a repository and a client?
@hdkloh6857
@hdkloh6857 6 ай бұрын
These auto generated model classes aren't parcelable, so how can we transfer data between different screens ?
@twinspast141
@twinspast141 Жыл бұрын
hi philip.. im trying to Buy some of your course but idk how to calculate the fees , because in my visa card i have 250 euros but when i want to buy your 99 course the page tells me that i don't have money enough !! WTF Im from argentina! Can u help me pls? because im trying to buy you course every time but idk why i cant!!
@BapeRuLLZ
@BapeRuLLZ Жыл бұрын
I wonder how well this scales. I feel like with this approach you need to be at least somewhat familiar with how the data is structured on the backend whereas with a rest api you can view it as a blackbox ("I dont care how or where you get it from, just give me this and that"). You can create rest api calls on a per view/screen basis (organized by sub-urls) which only gives you what you need in one package with one call, thus saving phone resources and bandwidth. I feel like with graphql you either have data related logic on client side which maybe shouldn't be there or you use it exactly like a well implemented rest api. What am I missing here?
@ChrisAthanas
@ChrisAthanas Жыл бұрын
There are many systems that have API's that grow over time from the Rest implementation. Most backends are not well designed with the client in mind, not delivering the minimal payload. Its just not been a priority for the BE community. GraphQL is a trade-off solution for these older systems where they can put a layer between the BE and the FE that allows the FE to reduce the payloads on the network, but the tradeoff is that the BE needs to be implemented that can perform those BE calls in a GraphQL way. If you are greenfielding a project and you know you will creating it for mobile, GraphQL is likely overload, as you can restrict your API's for mobile, or have separate calls for mobile.
@nicolascambuy1507
@nicolascambuy1507 Жыл бұрын
Nice!
@bahaaalkhateeb6583
@bahaaalkhateeb6583 Жыл бұрын
Sound great, but does the API or server-side need to handle anything to make this work?
@dmitriymorozov2680
@dmitriymorozov2680 Жыл бұрын
I love your videos. Could you dive a bit deeper into the topic and show how to handle error handling, pagination, interceptors?
@thousandcranes3045
@thousandcranes3045 Жыл бұрын
Wait remind me why do we need to provide usecases through modules? It's our own classes and not like ViewModel or Activities or like third-party classes such as Room DB object. Can't we just @Inject them?
@PhilippLackner
@PhilippLackner Жыл бұрын
No, how should dagger know how to create our own classes 🤔
@thousandcranes3045
@thousandcranes3045 Жыл бұрын
@@PhilippLackner eh im pretty sure u can constructor inject them, we do it all the time in our code base. Well we use Dagger2 but im pretty sure Hilt does the same since its basically an extension of it. The only time we cant constructor inject them directly is when we need to inject viewmodel/presenter to activity/fragment, or when we inject stuffs like third party object like Room
@KunalGoyal
@KunalGoyal 5 ай бұрын
I am not able to download using gradlew command as it is showing me error 'could not resolve classpath' for android gradle plugin and google play services. I tried multipe thing but not working maybe due to version catalogs. I am using gradle version 8.3.1. If anyone got this and solved..please help..thank you
@KunalGoyal
@KunalGoyal 4 ай бұрын
Worked for me after changing JDK version to 11 or jbr 17 in Settings ->Build, Execution, Deployment -> Build Tools -> Gradle
@ibrahimal-zaidi6436
@ibrahimal-zaidi6436 Жыл бұрын
Cool. Anyone here know how to use Android Printing Framework With Jetpack compose?
@kairoseini7183
@kairoseini7183 6 ай бұрын
Hey Philipp, Please can you tell me how to pdf file upload in graphql? mutation UploadUserHandBookFileQuery($productGroupId: String, $filePathKey: String, $file: Upload!, $enrollmentId: String) { uploadUserFile( productGroupId: $productGroupId filePathKey: $filePathKey file: $file enrollmentId: $enrollmentId ) { __typename url fileName expiresAt } } I am sharing query, Please help me. Thank you in advance.
@gofudgeyourselves9024
@gofudgeyourselves9024 Жыл бұрын
Please do GRPC next
@renzcarlosalanga6077
@renzcarlosalanga6077 Жыл бұрын
Mapping a list every time you fetch a data is kind of resource intensive specially when you have a large data set
@PhilippLackner
@PhilippLackner Жыл бұрын
Did you measure it? If yes, does it effect user experience? No? Then it doesn't matter 😄 There's a common saying that Premature optimization is the root of all evil
@renzcarlosalanga6077
@renzcarlosalanga6077 Жыл бұрын
@@PhilippLackner hmm yes loading times is much longer. Ill keep that in mind
@renzcarlosalanga6077
@renzcarlosalanga6077 Жыл бұрын
@@PhilippLackner if you implement paging I think you wont notice the difference
@ModeratorPolice
@ModeratorPolice 10 ай бұрын
how to do Mutation ?
@So7696
@So7696 9 ай бұрын
🇩🇿 thanks Philip
@zeeech2560
@zeeech2560 Жыл бұрын
How to get response code?
@camilohernandezruiz2776
@camilohernandezruiz2776 Жыл бұрын
9:25 I cannot see the entire command :C
@alisidhu
@alisidhu Жыл бұрын
Make api call with retrofit for Soap/xml please in kotlin
@ChrisAthanas
@ChrisAthanas Жыл бұрын
Those are dead protocols at this point. I have never seen a tutorial showing how to use retrofit with XML on android!
@alisidhu
@alisidhu Жыл бұрын
@philipp lackner?
@subyk6046
@subyk6046 Жыл бұрын
Nice content, thanks you very much! Can you make video about oauth 2.0, how and where store tokens and how to autologin correctly? :)
@ashok3533
@ashok3533 7 ай бұрын
- In plugin 'com.apollographql.apollo3' type 'com.apollographql.apollo3.gradle.internal.ApolloDownloadSchemaTask' property 'schema' doesn't have a configured value. i am getting this error could you please help me
@gofudgeyourselves9024
@gofudgeyourselves9024 Жыл бұрын
God's another name is Philipp Lackner
@gofudgeyourselves9024
@gofudgeyourselves9024 Жыл бұрын
@@alexpigeon i just goggled Sam witner as i didn't know who he was and he looks a lot like phillip
@camilohernandezruiz2776
@camilohernandezruiz2776 Жыл бұрын
Excellent, thank you very much for teaching this
ViewModels & Configuration Changes - Android Basics 2023
18:46
Philipp Lackner
Рет қаралды 118 М.
Make Your Code Clean With the SOLID Principles
18:24
Philipp Lackner
Рет қаралды 99 М.
He bought this so I can drive too🥹😭 #tiktok #elsarca
00:22
Elsa Arca
Рет қаралды 55 МЛН
Остановили аттракцион из-за дочки!
00:42
Victoria Portfolio
Рет қаралды 2,8 МЛН
My daughter is creative when it comes to eating food #funny #comedy #cute #baby#smart girl
00:17
GraphQL для мобильных разработчиков. Стоит ли использовать REST?
1:32:08
Android Broadcast. Все об Андроид разработке
Рет қаралды 4 М.
Clean Architecture for Android (Marek Osvald)
41:35
code.kiwi.com
Рет қаралды 1,5 М.
Should You Use Compose State or StateFlow in Your ViewModels?
13:59
Philipp Lackner
Рет қаралды 77 М.
Supercharge your GraphQL with Ktor and GraalVM by Derek Kuc
44:18
Kotlin by JetBrains
Рет қаралды 2,6 М.
GraphQL: The Documentary
27:58
Honeypot
Рет қаралды 574 М.
Build a modular Android app architecture (Google I/O'19)
32:21
Android Developers
Рет қаралды 176 М.
He bought this so I can drive too🥹😭 #tiktok #elsarca
00:22
Elsa Arca
Рет қаралды 55 МЛН