How to Make a Clean Architecture Dictionary App (WITH CACHING!) - Android Studio Tutorial

  Рет қаралды 72,682

Philipp Lackner

Philipp Lackner

2 жыл бұрын

In this video you'll learn how you can make a dictionary app that gets data from an API and caches it in a local room DB.
⭐ 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
Dictionary API:
dictionaryapi.dev/
Get the initial source code for this video here:
github.com/philipplackner/Dic...
Get the final source code here:
github.com/philipplackner/Dic...
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...

Пікірлер: 169
@luckydevil1601
@luckydevil1601 2 жыл бұрын
Guys if you're watching this video at the moment, just note that dictionary API has changed. It doesn't contain "origin" field nowadays. So remove it in the app files to make the app work.
@rahul_spawar
@rahul_spawar Жыл бұрын
I guess I'm lucky
@achalbadgujar9519
@achalbadgujar9519 Жыл бұрын
Thanks i was finding the issue for so long yes remove the origin field
@aliar99
@aliar99 Жыл бұрын
Where I can find it?
@user-hf7qy5su6w
@user-hf7qy5su6w Жыл бұрын
@@achalbadgujar9519 Can I get your help bcz I have not been able to run my app?
@SwapnilDeopurkar
@SwapnilDeopurkar 9 ай бұрын
Thank you.
@mahdibahmanpour1495
@mahdibahmanpour1495 2 жыл бұрын
I was working on a dictionary app and now I'm seeing you made a video about it, thanks a lot :)
@jaygitonga2026
@jaygitonga2026 2 жыл бұрын
I was waiting for this, thank God I subscribed! Thank you Philipp for listening
@jaygitonga2026
@jaygitonga2026 2 жыл бұрын
Type converters for database @ 26:20
@philipalveo
@philipalveo Жыл бұрын
Been watching you for a long time now, I'm kinda shy because I've been developing Android using Java then transitioned to Kotlin while working some projects on both, now will be fully transitioning to Kotlin and your videos are really helping me. Thanks and kudos to you man!
@shreyashachoudhary480
@shreyashachoudhary480 Жыл бұрын
Exactly what I was looking for! Amazing quality content, thanks!
@MaisUmSomente
@MaisUmSomente 2 жыл бұрын
Now That I,m leaning Jetpack compose, those classes are beeing AWESOME. THANKS for this Clean Architecture.
@sopharasum9354
@sopharasum9354 2 жыл бұрын
I love to watch your course. Thank you for sharing such wonderful knowledge for Andorid development in any kind of architecture.
@TheFlexath
@TheFlexath 4 ай бұрын
Thank you Philipp for your incredible dedication to Android developers around the world. You are the inspiration.
@muhammadirvan8655
@muhammadirvan8655 Жыл бұрын
Philip, you are kind and great person i have known in Android Space. Thanks for your dedication so far for Android developers around the world, please always share your knowledge for all Android developer who want to increase their skills, ur the Man! Thank you so much Philipp! keep it up!
@PhilippLackner
@PhilippLackner Жыл бұрын
My pleasure!
@guilhermerui8345
@guilhermerui8345 2 жыл бұрын
btw the origin and the synonymous of a word can also be null, so for anyone having issues with null exceptions that might be the case, anyways cheers mate really good stuff
@vedx
@vedx 2 жыл бұрын
Another master piece 👌🏻♥️♥️
@PhilippLackner
@PhilippLackner 2 жыл бұрын
Thank you! 😊
@jpdsah
@jpdsah 2 жыл бұрын
I was about to ask for this yesterday, thank you so much sir
@MtaufiqH731
@MtaufiqH731 2 жыл бұрын
I hope you make multi module project in the future sir. Really great youre truely master
@Momo-zi2hi
@Momo-zi2hi 2 жыл бұрын
He will make a course about that
@MtaufiqH731
@MtaufiqH731 2 жыл бұрын
@@Momo-zi2hi oh nice. I hope so. He is great .
@trocchiettoski
@trocchiettoski 2 жыл бұрын
Multi module with clean is a must
@vorpalchoppers
@vorpalchoppers 2 жыл бұрын
Thanks for such a quality video, Philipp!
@miracleukaka4085
@miracleukaka4085 Жыл бұрын
Thank you so much Philipp, you're a blessing.
@bjugdbjk
@bjugdbjk 2 жыл бұрын
Wow man, u r back with a bang !! Great !!
@nonconsensualopinion
@nonconsensualopinion 2 жыл бұрын
You always deliver. Subscribed!
@tonnie7079
@tonnie7079 2 жыл бұрын
Just landed here for the 3rd straight lecture on Clean Architecture, should be the Assistant Professor after this one.
@davidespano8674
@davidespano8674 2 жыл бұрын
Great work among the best of the best out there. Thanks.
@LG51hacker
@LG51hacker 2 жыл бұрын
Excellent tutorial. Thank you for sharing :)
@josuspraiser8205
@josuspraiser8205 2 жыл бұрын
As Usual another great video ,thanks for the knowledge! I would like to know how an app is scaled with at least two features using the same arch and principles, video on that would be greatly welcomed!!
@JossEnssy
@JossEnssy 2 жыл бұрын
Very well...!! I am from peru, and this dictionary will be perfect to learn to pronounce inglish words ..
@ma.fouani
@ma.fouani Жыл бұрын
great content! thanks a lot for all of this effort
@Kangsemo
@Kangsemo Жыл бұрын
For new projects I like to use android modules for features not only packages. So you can make use of parallel compilation from gradle. But nevertheless a great video :)
@wdoodoo1
@wdoodoo1 Жыл бұрын
Your videos are really helpful, thank you!
@kunduztalaybekovna8406
@kunduztalaybekovna8406 2 жыл бұрын
whenever I learn something new, Philip puts out a video on this topic. It is very easy and interesting to learn android with you. Thank you Philipp. And can I ask you to make a video how to create android widgets from json schema and ui schema getting from api in Jetpack Compose?
@7xFuryPlayz
@7xFuryPlayz Жыл бұрын
there is an api but its still in initial phase , you can't do much with this api yet so you have to stick with old android apis for now
@re7650
@re7650 2 жыл бұрын
Simply God! Love from india
@priyanshumaurya7903
@priyanshumaurya7903 2 жыл бұрын
thanks bro... please provide more awesome content(small projects) like this
@user-gy5kw5bf4q
@user-gy5kw5bf4q 2 жыл бұрын
Bro, you are really cool.Thanks for videos. Respect from Russia.
@rabaka7899
@rabaka7899 2 жыл бұрын
Thank you for this!
@johndominicjasmin
@johndominicjasmin 2 жыл бұрын
I learned a lot sir thank you
@ojo_lali_ngaji
@ojo_lali_ngaji 2 жыл бұрын
always making great videos
@techmarinar
@techmarinar 2 жыл бұрын
The best of the best❤️❤️
@funnymoment9164
@funnymoment9164 2 жыл бұрын
Thanks!!! You are the best!
@subindsuresh4897
@subindsuresh4897 2 жыл бұрын
Thanks as always bro.
@pankajsagar9550
@pankajsagar9550 2 жыл бұрын
great explanation
@RRRazzzaRRR
@RRRazzzaRRR 2 жыл бұрын
so far, so good!
@flowzk921
@flowzk921 2 жыл бұрын
Very useful Video! Many thanks Philip! could you do a tutorial on multimodule app with Hilt
@hasanzolfagharipour
@hasanzolfagharipour 2 жыл бұрын
so good, excellent
@XuanQuynhLexuanquynh
@XuanQuynhLexuanquynh Жыл бұрын
Good job man.
@user-jh7zx4jg1y
@user-jh7zx4jg1y Жыл бұрын
You are the best❤
@marinbeslo7841
@marinbeslo7841 2 жыл бұрын
First a like, I'll watch the video tonight :)
@patrik956
@patrik956 2 жыл бұрын
I NEED TO GIVE LIKE!
@Richard5thV
@Richard5thV 2 жыл бұрын
Ehhh. That getWordInfo function implementation looks a bit strange. Couple of things I am curious about there. When you catch and emit an error the code block seems will continue to emit the success case afterwards. Secondly. Do you really want to group the api get request and the saving/deleting to database together in the try catch block? Now it could be the case that the api call went well, but you will be emitting old data when you run into a database exception?
@mkjvd
@mkjvd 2 жыл бұрын
Superb!
@nourmorgan6751
@nourmorgan6751 Жыл бұрын
Hi Philipp, first of all thanks for your videos can you make a tutorial about paging 3 especially using the remote mediator for caching and fetching the data
@alishernuraliev9075
@alishernuraliev9075 2 жыл бұрын
thank you!
@hossamatef7234
@hossamatef7234 2 жыл бұрын
Thanks 🙂
@dreamer6228751
@dreamer6228751 2 жыл бұрын
Hey bro it's very good video 😊!)
@PhilippLackner
@PhilippLackner 2 жыл бұрын
Thanks!
@dev_jeongdaeri
@dev_jeongdaeri 2 жыл бұрын
Suuuuper coooool 😎
@bitwisedevs469
@bitwisedevs469 2 жыл бұрын
Awesome, I just have a question. In your sample you reuse Meaning data class (domain) in WordInfoEntity, is this really how it's done because I am expecting that we will create a new Meaning data class (entity)? Thanks
@yunusemrearslan3696
@yunusemrearslan3696 2 жыл бұрын
I wish I could hit the like button more than once
@germenwong
@germenwong 10 ай бұрын
Very good course, I found that you used a lot of code generation shortcuts in the course, which would be very convenient. Can you provide a tutorial
@amineayachi335
@amineayachi335 2 жыл бұрын
thanks for the great videos
@PhilippLackner
@PhilippLackner 2 жыл бұрын
Glad you like them!
@alwaysbrillant10
@alwaysbrillant10 2 жыл бұрын
Sweet 👍🏽
@dkyadav5322
@dkyadav5322 2 жыл бұрын
Keep it up 👍🏾👍🏾👍🏾👍🏾
@PhilippLackner
@PhilippLackner 2 жыл бұрын
Thanks!
@taraszhupnyk2998
@taraszhupnyk2998 2 жыл бұрын
What do you think about MotionLayout Compose? Can you do tutorial for complex animation?
@TheZukkino
@TheZukkino Жыл бұрын
Great video but, there's a little issue with Converters class. Unfortunately the *object : TypeToken(){}.type* call depends on GSON library. This invalidates the huge interface usage advantage. In fact if you implement a JacksonParser you are forced to use *object : TypeReference(){}.type* . Do you have any idea to solve this problem?
@Gaurav25357
@Gaurav25357 2 жыл бұрын
Nice video.. How you have added Gson without including Google Gson dependency in app level gradle??
@farhad9579
@farhad9579 2 жыл бұрын
hey philipp can you make 1 Clean tutorial XML Please
@chouaiebdebbebi9228
@chouaiebdebbebi9228 2 жыл бұрын
Can you do a tutorial on mvi with clean architecture , thank you!
@begmyratmammedov9357
@begmyratmammedov9357 2 жыл бұрын
Hi Philipp, first of all thanks for your videos. I think we should wrap a response that returned from Retrofit request to Dto object instead of Model object, am I wrong? Thanks))
@howididit917
@howididit917 Жыл бұрын
I think you are right
@devetips
@devetips 2 жыл бұрын
awesome :)
@liosha2007
@liosha2007 2 жыл бұрын
Thanks a lot for your lessons. They are really helpful. The only question I have, is repository a good place to make network request? For me it looks like use case should do it. But in this way repository will have all create/delete/get methods, that duplicates DAOs methods... What do you think about it?
@PhilippLackner
@PhilippLackner 2 жыл бұрын
No, thats what the repo does. It accesses your different data sources and provides functions for the use cases. The use cases shouldn't know where the data comes from. They're part of the domain layer, not data
@liosha2007
@liosha2007 2 жыл бұрын
@@PhilippLackner ok, I understand. Thanks a lot for the answer.
@satishyou2b
@satishyou2b 2 жыл бұрын
Great content and so engaging to watch and learn. One thing I didn't understand. Why did you put Repository interface at domain layer and it's implementation in data layer, isn't data layer innermost in this and it should expose Repository interface?
@PhilippLackner
@PhilippLackner 2 жыл бұрын
No it's the other way around. Domain is the innermost layer. All layers can access domain, but not all layers can access data
@ackerman6992
@ackerman6992 2 жыл бұрын
Can we see android with backend (springboot/django/nodejs) in future?
@raveendrann7033
@raveendrann7033 2 жыл бұрын
1st view ❤️😂
@PhilippLackner
@PhilippLackner 2 жыл бұрын
0th view
@MrBaninations
@MrBaninations 2 жыл бұрын
@@PhilippLackner that there, thinking in code
@ChrisAthanas
@ChrisAthanas 2 жыл бұрын
I just finished my version of the app and even added the ability to play the mp3 audio link fir the words
@bitwisedevs469
@bitwisedevs469 2 жыл бұрын
Would you create a tutorial with multi-module/modular approach?
@salarioio367
@salarioio367 2 жыл бұрын
Hi Phillipe, can you explain how to deal with navigation and shared staff between features? for example if you use jwt token, you need to Manage it in the Auth api in the Auth feature, but it also needed for every network call.
@PhilippLackner
@PhilippLackner 2 жыл бұрын
Put it in preferences in the core module
@chatgpt-undetected
@chatgpt-undetected 2 жыл бұрын
Is there a way to implement google sign in with clean architecture without puting my logic in the UI layer
@vaibhavjaiswal5911
@vaibhavjaiswal5911 2 жыл бұрын
why don't we just collect from room . After getting from api , we just save it in room and as the viewModel collects from room , it will updated ui according to data from room?
@hyrulelink16
@hyrulelink16 2 жыл бұрын
Do you have any similiar examples/tutorials without compose?
@penakati
@penakati 2 жыл бұрын
Good
@Adam0001
@Adam0001 Жыл бұрын
Hello Philipp, I have a question (45:01). First of all Thanks for this tutorial, great as always, my question is, In line 26 in WordInfoRepositoryImpl, we want to delete old cached data, right? but you pass to the delete function remoteWordInfos (the new data) instead of wordInfos (the old data). Is what I am saying right?
@ignaciolo
@ignaciolo 4 ай бұрын
I was looking for this comment because I think the same as you
@khalilsamti6495
@khalilsamti6495 2 жыл бұрын
HI Philpp , want to know please . in clean architecture when is it beneficial to put data and domain layers in seperate modules ? thanks
@pinoy_marites_beh
@pinoy_marites_beh 2 жыл бұрын
I would assume you have already some SOLID principles, some design patterns and Architecture knowledge, I also ask the same thing (not exactly what you asked but the thought of it), most of the time if not always, ask yourself first if you need to do it, "YAGNI". Imagine youre doing a simple Dashboard proof of concept (POC) for lets say a user profile information to show some stakeholder a glimpse of your team's feature, I wouldn't mind architecting them at all, I'm just gonna throw everything in 1 package, but still follow the principles that I know as much as possible. trust me YAGNI principle saves me a lot of headache
@abdremo
@abdremo 2 жыл бұрын
nice, but i have a question, why did you use onEach over collect or collectLatest in the ViewModel?
@PhilippLackner
@PhilippLackner 2 жыл бұрын
Saves a little indentation because you don't need a collect block, but no issues using collect :)
@karamba6936
@karamba6936 Жыл бұрын
I am not sure. But can I make word primary key for room and with onconflict strategy write above without cleaning cash?
@frustratedengineer5417
@frustratedengineer5417 2 жыл бұрын
can you tell about the advantage of using explicit dependencies like courotines and lifecyclescope etc. I mean aren't these are already there. shall be gratefull if anybody can explain this And I love your tutorials by the way ❤❤❤
@karanjhinga
@karanjhinga 2 жыл бұрын
coroutines dependency for Flow, we can't use flow without it. Lifecycle scope wasn't needed here because he was already using live data otherwise it is required for repeatOnLifecycle or launchIn blocks that are much needed when using flow inside the ui layer as well.
@nervous711
@nervous711 2 жыл бұрын
33:12 Why TypeToken is of ArrayList but not just simply List
@user-rz1hv
@user-rz1hv 2 жыл бұрын
I'm just curious, why not to have an interface of the domain model instead of a data class? And then implement that interface in data layer as a Room entity, and both in domain and presentation operate with interface model
@user-wk8hs9ko1b
@user-wk8hs9ko1b 7 ай бұрын
hi philipp i use app that's get the data from internet and add this data to local and show that data to ui but i show the data from network directly because the data has images URL and i use glide to show it i use flow to get the data to Ui and i emit multiple value at first show the data from local and then try to get the data from internet and save the data to local and in the view model i use state flow to show loading or success or fail but when i get the data and open the app again the state flow return success and with the old network call with resource success and not force the new flow
@rohitjakhar6672
@rohitjakhar6672 2 жыл бұрын
Great video, I watched your cryptocurrency app video and learn a lot more. Can we share use can in 2 apps ? like we need to create two app, one is for user and another for host . both have some common features so writing different use case in different app can we share one use case on both app ?
@jagovanderstap4000
@jagovanderstap4000 Жыл бұрын
Wouldn't deleting and inserting cause 2 emits (and using a transaction fix that)?
@ahmad7a.4k28
@ahmad7a.4k28 2 жыл бұрын
💪💪
@aathithyansriramachchanthi6797
@aathithyansriramachchanthi6797 2 жыл бұрын
Brother, Please can give the image tree of this video project(Dictionary app) architecture. It will more help full to understand easily Thank you
@rafael36326
@rafael36326 2 жыл бұрын
makes a video showing your plugins and showing how it works
@tonnie7079
@tonnie7079 2 жыл бұрын
Stuck at 26:30 is there a way of doing this in Moshi instead of GSON?
@PhilippLackner
@PhilippLackner 2 жыл бұрын
Moshi should have similar functions to parse to and from json
@alilouali1570
@alilouali1570 2 жыл бұрын
Hello thank you for this video how to create dictionnary app with math equation and images
@bayramozer1121
@bayramozer1121 4 ай бұрын
First thanks all, I want to use on my own database and I use it offline, what do I need to do? By changing this codes, can I build what I want?
@PankajKumar6493
@PankajKumar6493 Жыл бұрын
At 21:30, are we allowed to using "Meaning" from domain layer here? Entity is in data layer, so wouldn't it mean it is dependent on domain, going against Clean Architecture?
@PhilippLackner
@PhilippLackner Жыл бұрын
Domain can be access from any layer
@PankajKumar6493
@PankajKumar6493 Жыл бұрын
Oh wow..... Thanks for the quick reply
@eduardopaucar9949
@eduardopaucar9949 2 жыл бұрын
Why you don't put the injection constructor in the use case and the repository implementation?
@anatolvasko6626
@anatolvasko6626 Жыл бұрын
I think the reason is: for people who don't know about Hilt or Dagger or Koin
@s.halder3280
@s.halder3280 2 жыл бұрын
Hi Philipp, I like to take your 'Powerful Kotlin REST APIs With Ktor' course. Do you have a promo code for it? Please let me know. Thanks!
@PhilippLackner
@PhilippLackner 2 жыл бұрын
You're lucky that later this day my black Friday sale week will start :) subscribe to my email newsletter here to not miss the email: pl-coding.com/newsletter
@a_toshmatov
@a_toshmatov 2 жыл бұрын
Hi can we use this Api in our app too
@ravshanbaxranov
@ravshanbaxranov 11 ай бұрын
Why you didn't use Response as return data in Api?
@pierre.vieira
@pierre.vieira 2 жыл бұрын
I found it a little strange that you put the data retrieval logic in `WordInfoRepositoryImpl`, in this case the ideal would not be to do this in the use case `GetWordInfo` making `WordInfoRepositoryImpl` only make the calls of the methods present in the `api` and in the `dao`?
@PhilippLackner
@PhilippLackner 2 жыл бұрын
But in the end that's exactly the job of the repository to decide which data goes through. Not sure if the use case really needs to know about what happens with the data, it should actually just get it and not care where it comes from
@pierre.vieira
@pierre.vieira 2 жыл бұрын
@@PhilippLackner I understood what you said. However, it still seems a little strange because in this case `WordInfoRepositoryImpl` executes some data type conversion logic and is responsible for controlling the states of "loading", "error" and "success", for me this shouldn't be role of the repository, but just worrying about informing how the data will be obtained. For me, in this case, the best way would be for the repository to have 2 methods something like: `getDataFromWeb` and `getDataFromDatabase`, in the repository implementation we would only call the methods present in `api` and `dao` respectively, without worrying about "emit" logic (loading, error and success) and how the caching should be done, passing that responsibility to the use case... But of course that's just the way I see it and I'm not specialist.
@eduardopaucar9949
@eduardopaucar9949 2 жыл бұрын
I also had that doubt
@rahmat-un4od
@rahmat-un4od 2 жыл бұрын
nice , we need zoom capture on your videos. too small to see
@Hanna-ir6te
@Hanna-ir6te 2 жыл бұрын
Is this tutorial with clean architecture of MVVM?
@noyaljose9635
@noyaljose9635 2 жыл бұрын
Is it okay if we use use cases for repositories?
@PhilippLackner
@PhilippLackner 2 жыл бұрын
No
@dededarirahmadi8271
@dededarirahmadi8271 2 жыл бұрын
do you have xml version of this tutorial?
@anatolvasko6626
@anatolvasko6626 Жыл бұрын
Did you find any info that can help implement offline cashing? This video is easy to undersant for me until I saw, that ui is Compose :)
Nutella bro sis family Challenge 😋
00:31
Mr. Clabik
Рет қаралды 12 МЛН
DO YOU HAVE FRIENDS LIKE THIS?
00:17
dednahype
Рет қаралды 93 МЛН
3M❤️ #thankyou #shorts
00:16
ウエスP -Mr Uekusa- Wes-P
Рет қаралды 14 МЛН
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 59 МЛН
(Shocked) ChatGPT created this Android App and made $$$?
18:32
Harnoor Singh
Рет қаралды 133 М.
How to Do 90% of What Plugins Do (With Just Vim)
1:14:03
thoughtbot
Рет қаралды 872 М.
Clean architecture Android - диаграмма Use Case | Чистая архитектура
22:27
Clean Architecture in Android in 5 minutes
5:17
Renaro Santos
Рет қаралды 19 М.
Nutella bro sis family Challenge 😋
00:31
Mr. Clabik
Рет қаралды 12 МЛН