The BEST Way to Implement a Search In Jetpack Compose - Android Studio Tutorial

Sdílet
Vložit
  • čas přidán 7. 02. 2023
  • In this video you'll learn how to implement a search functionality in your Jetpack Compose project.
    ⭐ 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 be your mentor and become an industry-ready Android developer in 10 weeks:
    pl-coding.com/drop-table-ment...
    Subscribe to my FREE 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/Sea...
    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...

Komentáře • 72

  • @cking24343
    @cking24343 Před rokem +13

    Your timing is impeccable lol. I was about to search for this topic, then I got a notification of the video posting.

  • @safionweb
    @safionweb Před rokem +17

    Even if I know the topic, I still watch your videos to the end because there is always something new to learn. In this video, I learned about the debounce operator. Amazing work. Thanks, @Phillip!

  • @rpitpatel1004
    @rpitpatel1004 Před rokem +2

    that's great video. No one actually doing live coding and explaining these days. Thank you @Philipp

  • @PamontBahktar
    @PamontBahktar Před rokem

    I really do love your tutorials Philipp, thanks so much

  • @makzimalist
    @makzimalist Před rokem

    Again, very good and interessting video!!! even as a senior developer i always watch your videos and going to learn something new. keep on the good work! 🙏

  • @AlexKind1917
    @AlexKind1917 Před rokem +1

    I looked for something similar. Thank you! Cool video!

  • @AndroidDeveloperTips
    @AndroidDeveloperTips Před rokem +4

    Neat and right to the point as usual. Keep doing the great work. 👌

  • @iamadetoye
    @iamadetoye Před rokem

    Perfect!!!
    Appreciate you Phillip

  • @sasha0elf
    @sasha0elf Před rokem

    Thank you so much, Philipp!

  • @mustafaammar551
    @mustafaammar551 Před rokem +2

    Very cool video
    Wish you all the best 👍👍

  • @mryup6100
    @mryup6100 Před 7 měsíci

    This will be very useful in my app! Thank you Phillip!

  • @sevbanthebuyer
    @sevbanthebuyer Před rokem

    Perfect ! Thank you.

  • @coderstubechannel
    @coderstubechannel Před rokem +2

    Super tutorial for us programmers 💪

  • @bharathprakash
    @bharathprakash Před 11 měsíci

    Sir I learnt a lot from your videos..
    Great video I was struggling to implement a correct way to search in the large size lists this helped me a lot.

  • @LoveOurLife19
    @LoveOurLife19 Před rokem +6

    I really thank you for all your videos. I have learned many things from your channel. Recently, I know the concept of Android app modularization. But i don't know how to combine it with MVVM + Clean Architecture. I see quite a few videos about MVVM + Clean Architecture in your channel, its very useful. So can you make the video talk how to implement MVVM + Clean Architecture + Modularization? I think many people are also looking forward to this topic. I hope you see my comment. Finally, thank you for everything

  • @sonnguyenphuc8142
    @sonnguyenphuc8142 Před rokem

    thanks you so much i'm looking for this

  • @EmanNollase
    @EmanNollase Před rokem

    Nice awesome!!!

  • @ka61er
    @ka61er Před 9 měsíci

    so helpful

  • @PandaTop.
    @PandaTop. Před rokem

    Thanks! Дякую :)

  • @johnshepard1267
    @johnshepard1267 Před rokem

    HAHA, I was just about to start implementing the search for my project and you release that video, wow! Thank you!
    Can u make a video on how to make animated toolbar while scrolling. The case for example is a Profile screen. When you're in the top position of the screen - is has a big picture which covers all the top protion of the screen including the toolbar (with the clock and battery charge icon etc). But when you start scrolling the screen - the image and the user name collapses into a circle and name in the toolbar?
    Another video idea: a Card view with images that you can switch by swiping left and right with the animated indicator of images count (like dots or something else)
    And another one: a feature that allows you to upload multiple images (from the gallery or making multiple photos in the camera right away) into views and uploading them to the server

  • @proandroiddevir
    @proandroiddevir Před rokem +3

    as always The training was excellent and effective 🙏🙏🙏🙏🙏👏👏👏👏👏👏

  • @alejandrogallego5419
    @alejandrogallego5419 Před rokem +1

    Thanks a lot

  • @favour2871
    @favour2871 Před rokem

    nice

  • @kevalkanpariya
    @kevalkanpariya Před rokem

    Is it's good to use stateflow instead of mutableState(from compose API) specifically for this usecase

  • @ahmadfitriyansah2937
    @ahmadfitriyansah2937 Před 7 měsíci

    Great vid
    Is there a reason why you put matchingCombinations inside doesMatchSearchQuery?
    Wouldn't it better to put it outside as a val in Person class?

  • @mrjackson9137
    @mrjackson9137 Před 10 měsíci +1

    Could you please make a video about SearchBar in Compose?

  • @antpr2
    @antpr2 Před rokem

    Today I learnt that there about the .update{} function, I've always been using .value !

  • @stezo9770
    @stezo9770 Před rokem +3

    Thanks, Philipp. Great video, as always. Left you a coffee (actually 2) :)
    I have a question. What would be best practice if I wanted to show search results while the search is still in progress?
    I mean for cases where I don't want to use pagination and the search takes some time, but the API returns intermediate results.
    In case there is no short and easy answer for that, and you didn't already post a video I missed, it would be a nice topic for a video in the future.
    Thanks.

    • @PhilippLackner
      @PhilippLackner  Před rokem +5

      Thanks for the coffees 👍🏼👍🏼
      That could be achieved with a custom flow in which you perform the search. Every time you get results, you emit them in the flow

  • @lifebylazy
    @lifebylazy Před rokem

    Just gonna leave a comment here to help the algorithm

  • @user-wr9es5lu2p
    @user-wr9es5lu2p Před 2 měsíci

    hey philipp great video btw, i was wondering what if i wanna implement something like this where in the text field the user only puts "phi" and the rest of the characters of the possible result are there for eg : -
    "Phil"ipp lackner

  • @moisesvalera3597
    @moisesvalera3597 Před rokem

    Nice video, but this one is affecting unit tests of my ViewModel because asserting that persons StateFlow value can come with default value is always throwing error.

  • @djpharaohoftime3200
    @djpharaohoftime3200 Před rokem

    How would you do this with a database ( such as sqlite) so that the list can reload after filtering?

  • @somdatatechnology233
    @somdatatechnology233 Před rokem

    Mr philipp, please make same lesson with Retrofit and paging 3? i need it

  • @AntonK-ql2ev
    @AntonK-ql2ev Před měsícem

    Philipp, thanks for the lesson, but how can get data from a file to listof?

  • @elohimalves
    @elohimalves Před rokem

    Phillip, please 🥺, make a video about the best way to get offline text, is xml files the best idea?. How to use strings in strings.xml and how to search those strings using jetpack compose. I'm having a lot of trouble making a offline quiz app using xml to place a large amount of text.

  • @androiddeveloper3343
    @androiddeveloper3343 Před rokem

    ❤❤❤

  • @maciejnowak2120
    @maciejnowak2120 Před rokem +1

    Hi!
    Do you have and idea how to implement search panel with/in dropDownMenu? I tried to do it but i have one problem. When user press longer than normal click on Search app is crashing. Im trying to solve it but nothing works:((

  • @skjahirhossain5084
    @skjahirhossain5084 Před rokem

    Please make a video on three type of mutableSharedflow converted to single livedata. One is for search and second one is for sorting and third one is for filter. All in room database with rcv list adapter

    • @ChrisAthanas
      @ChrisAthanas Před rokem

      Whats the improvement by using livedata here?

  • @Coldalecs
    @Coldalecs Před 3 měsíci

    Hot to make the Keyboard show the Search icon instead of Enter when inside the search field?

  • @maksBan1919
    @maksBan1919 Před 2 měsíci

    How can I now put this _searchText, _person etc. to another class representing states for that screen? Typically i would have "_someScreenState" class and inside values which are basic types like strings, ints etc. In this case my searchText would be just a normal string and we cannot use "combine" function

  • @favour2871
    @favour2871 Před rokem

    philip do u find urself using xml from time to time? or just only compose

    • @PhilippLackner
      @PhilippLackner  Před rokem +1

      Not for new projects, but for older ones that still use it

  • @godeons
    @godeons Před 4 měsíci

    Point me to your beginners guide on jetpack compose please

  • @abada-s
    @abada-s Před rokem

    Why didn't you override the in operator or the contains function

  • @David-zb8br
    @David-zb8br Před rokem

    Could you please do something similar to this but with sorting? by name and last name thx 😁

  • @deepmashru8951
    @deepmashru8951 Před rokem

    I wanna like to meet Beff Jezos..

  • @nymexe
    @nymexe Před rokem +1

    I got a question. If we have list of people, should we name the variable people or persons? You're naming it persons, but whats wrong with people?

    • @PhilippLackner
      @PhilippLackner  Před rokem +1

      Because the class is named person, so the intuitive naming is just the plural of it. Otherwise you could also call it humans, but nobody would guess that if they don't see it

    • @markfrelih
      @markfrelih Před rokem

      @@PhilippLackner But the plural of person is people

    • @PhilippLackner
      @PhilippLackner  Před rokem +2

      @@markfrelih Oh lol, didn't know that haha

    • @ChrisAthanas
      @ChrisAthanas Před rokem

      @@PhilippLackner adding an "s" for lists of objects is a common idiom in Kotlin, and using "persons" instead of "people" would be acceptable for quick understandability, even if its not proper english.

  • @LucasYamato
    @LucasYamato Před rokem

    Friend can not put caption on the videos of your course please ?

  • @CosmoVision1
    @CosmoVision1 Před 10 měsíci

    Beff Jezoz

  • @olegleonov1310
    @olegleonov1310 Před rokem

    `doesMatchSearchQuery` inside `Person` brakes SOLID principles. It's better to move this function to another class.

    • @PhilippLackner
      @PhilippLackner  Před rokem +4

      As I mentioned in the video to make a searchable interface 🤷🏼‍♂️

  • @alphacoder3822
    @alphacoder3822 Před 11 dny

    bro are you searious? your courses are 33Lakh rupees for one course ? dude wtf

    • @PhilippLackner
      @PhilippLackner  Před 11 dny

      @@alphacoder3822 it's just India that makes 9900€ out of 99,00€😂 you're just using a different decimal system, the courses are all 60 - 160€.

  • @yuhenteng4694
    @yuhenteng4694 Před rokem

    everytime I want something to implement, and you will make a video about it hhhhh