Retrieving Data - Firebase Firestore

Поділитися
Вставка
  • Опубліковано 15 вер 2024

КОМЕНТАРІ • 54

  • @Alchemist10241
    @Alchemist10241 3 роки тому

    Your website's quizzes are so tricky and includes all the materials you need to memorize! Excellent!! ✔✔✔

  • @lindaporsius
    @lindaporsius 4 місяці тому

    3 years ago, but still very helpful!

  • @norulesprateek
    @norulesprateek 4 роки тому +5

    Well, didn't know it could be this simple! Thanks, I thought I would have to go through hell to understand Firestore.

  • @matt-g-recovers
    @matt-g-recovers 3 роки тому

    Absolute GOLD
    I can't believe more people don't follow you...
    I may watch others to get a different view or see a specific implementation but at the end of the day, I use your videos for the gold standard by which I write my production code... with common sense of course, these are examples so of course it's assumed many checks may be ommited or specific modularity avoided for simplicity but for Android Konvention... all you!

  • @Anugrahdev
    @Anugrahdev 4 роки тому +2

    learn a lot from your playlist👍

  • @devOmarAZ
    @devOmarAZ 3 роки тому

    Thanks From my heart

  • @topcutestanimals6039
    @topcutestanimals6039 3 роки тому +2

    sb.append("$person
    ") didn't work for me. It returned the addresses of objects ex: appPackage.Person@ad47a3c
    sb.append("${person?.firstName} ${person?.lastName} ${person?.age}") works ok!
    Maybe some update on firebase :/ or I missed something...
    PS: Thanks for your tutorials, you are my nr.1 teacher on YT!

  • @abhas_kr
    @abhas_kr 3 роки тому

    I am receiving Person and some numerical value next to it, it's like address of Person object. I am not able to receive Person details in my textview. Any help would be appreciated.

  • @robertoanold4719
    @robertoanold4719 4 роки тому +1

    Great tutorial make us know much about coroutine but is it neccessary to use maybe viewmodel when dealing with firebase

    • @PhilippLackner
      @PhilippLackner  4 роки тому +1

      In a real app you should always have a proper architecture like MVVM of course

  • @mcircle6489
    @mcircle6489 4 роки тому +1

    Why.await() not working 2:36

    • @redaantar8908
      @redaantar8908 3 роки тому

      same problem i think u should write it in async {} and then call put it in a val and call the valName.await()

    • @marcoantoniomartiniano8488
      @marcoantoniomartiniano8488 3 роки тому

      maybe you forgot to put dependencies

  • @sololearners2629
    @sololearners2629 4 роки тому +1

    some functions are not working, is it because of the version update? I've copied all the dependencies that you've instructed.
    .await() and querySnapshot.documents can't be called..
    can you help me with this?
    thanks for your other vid tutorials , very helpful for beginners..

    • @EduardoMustainee
      @EduardoMustainee 4 роки тому

      Did you get it solved?

    • @sololearners2629
      @sololearners2629 4 роки тому

      @@EduardoMustainee ​ I haven't using this method , but I've read through the google firestore documentation and there was a different syntax in retrieving and managing data.
      That is what I've used instead and it is working..
      There maybe version changes that is why some of the functions can't be called anymore(removed/updated).

    • @sololearners2629
      @sololearners2629 4 роки тому

      @@EduardoMustainee update, I got it to work now by re-inserting the dependencies needed in the firestore console(instructions are there) and by updating the "Configure Kotlin Plugin Updates" in the android studio.
      if this doesn't work try rebuilding the project. hope this helps

    • @lyndon562
      @lyndon562 4 роки тому

      @@sololearners2629 I have tried this and the await() function still wont call. Please help me with this? which dependencies did you use?

  • @Arcantheon
    @Arcantheon Рік тому

    If I want to show a shimmer effect while something is loading, should I simply remove the await function and remove the shimmer once the data is retrieved?

  • @hassanammer7854
    @hassanammer7854 4 роки тому

    Excellent

  • @sat_talk
    @sat_talk 2 роки тому

    Thanks bro. But in mine similar type project. it didn't work and in run console it messaged me..
    description=The query requires an index. You can create it here: web link is given to create indexing of that particular collection field...
    It has been noticed that in one of my other previous project it didn't ask me to create indexing but in my current project it asked. what could be the reason?

  • @matt-g-recovers
    @matt-g-recovers 3 роки тому

    For some reason, the await() function won't compile...I have the ktx dependency and my other functions work fine it just has no idea what I'm trying to reference.

    • @matt-g-recovers
      @matt-g-recovers 3 роки тому +2

      Nevermind, I thought I double checked my dependencies but that was it...as it had to be ;)
      Cheers!

  • @mikdadmrhij2447
    @mikdadmrhij2447 2 роки тому

    what's mean this error
    Caused by: org.gradle.api.internal.tasks.properties.PropertyEvaluationException: Error while evaluating property 'filteredArgumentsMap' of task ':app:compileDebugKotlin'

  • @ravisorathiya1756
    @ravisorathiya1756 3 роки тому

    Rather than using try catches
    As that corotines scope return job
    So on that job we can use invokeoncompletion and then get throwble if exist
    Isn't that good idea? Or looks cleaner code than this one?

  • @Music-lv8xf
    @Music-lv8xf 4 роки тому

    is it possible to access nth position on the result query in firestore?
    example (find handsome person and returns 10 personDocument)
    is it possible to access 9th, 3rd or any nth number in the query result??

  • @md.imranhossain5364
    @md.imranhossain5364 3 роки тому

    can we store images in Firebase firestore instead of Firebase storage ? if yes please help me.

  • @mouhibsahloul2577
    @mouhibsahloul2577 3 роки тому

    how to retrieve a single field not the whole object

  • @haroldhermosa4680
    @haroldhermosa4680 2 роки тому

    How to do this using compose?

  • @Ok-Chance
    @Ok-Chance 4 роки тому

    Thanks for the video ,
    is there a way to return only a one document from database with his id ?

  • @gamerzpress
    @gamerzpress 4 роки тому

    Can you make a video on a app for storing image with some information in firebase and retrieve the same in another page.

  • @moisesgomez7820
    @moisesgomez7820 3 роки тому

    Hi Phillip, I hope you are well! I have the following situation:
    I have a RegisterActivity where user can insert some fields and save them in Firestore. This part is working fine. I need to display that information in other activity but your video was not helpful for me, or I didn't well. Can you help me or give me some orientation? Thanks.

    • @kalibra2121
      @kalibra2121 3 роки тому +1

      Make a clickListener on a button to go to your second activity with a function where you put your "val intent = Intent( this, YourSecondActivityname::class.java)" and "startActivity(intent). Now on the other activity make a function like he did: retrievePersons() the only difference is that you'll need personCollectionRef variable from the MainActivity.. so you'll have like: "val querySnapshot = MainActivity.personCollectionRef.get().await()" in order to access this personCollectionRef you have to make it static, so put this variable in a companion object :) now everything will work properly because you can access that personCollectionRef from any activity.

    • @moisesgomez7820
      @moisesgomez7820 3 роки тому

      @@kalibra2121 thank you very much!!

    • @kalibra2121
      @kalibra2121 3 роки тому

      @@moisesgomez7820 You're welcome :D

  • @GakisStylianos
    @GakisStylianos 4 роки тому

    Is there a way to have a type-safe way when receiving those objects? For example, if we write but it is not actually a person object, I assume it will crash, or in this case, throw an exception and go inside the catch block right? Is that the only way to do this? I am wondering because later maybe something changes on the db and the code stops working because of it.

    • @PhilippLackner
      @PhilippLackner  4 роки тому

      I don't think that is possible atm. You have to use the catch block for that sadly

    • @GakisStylianos
      @GakisStylianos 4 роки тому

      @@PhilippLackner Gotta make certain that the tests cover that then, and if anything changes, the tests should notify me about it.

    • @PhilippLackner
      @PhilippLackner  4 роки тому

      @@GakisStylianos exactly, in that case tests can really save your butt

  • @Berk45632
    @Berk45632 4 роки тому

    Are get() and add() functions suspended? Is it necessary to call them using Coroutines?

    • @PhilippLackner
      @PhilippLackner  4 роки тому +1

      Nishant Aanjaney Jalan yea everything in firebase that returns a task is something potentially long running and can be suspended with await

    • @PhilippLackner
      @PhilippLackner  4 роки тому +1

      Nishant Aanjaney Jalan it’s not necessary to call them with a coroutine, the alternative would be an onComplete listener

  • @hanadanefa7837
    @hanadanefa7837 4 роки тому

    how can I actually display it in each textview and not in this manner -> Person(firstName=Android, lastName=Devs, age=22)

    • @PhilippLackner
      @PhilippLackner  4 роки тому +1

      textview.text = "${person.firstName} ${person.lastName} is ${person.age} years old."

    • @hanadanefa7837
      @hanadanefa7837 4 роки тому

      @@PhilippLackner how can I remove the default constructor? and add only what I retrieve from firestore database?

    • @hanadanefa7837
      @hanadanefa7837 4 роки тому

      I mean the value that you set

  • @mohitmahajan1947
    @mohitmahajan1947 4 роки тому

    Why
    int = -1
    is used as default value of age ?
    Why not 0?
    Can anybody tell me please 🤔

    • @PhilippLackner
      @PhilippLackner  4 роки тому +1

      Well, -1 is always an invalid age, so we know this doesnt come from the DB

    • @mohitmahajan1947
      @mohitmahajan1947 4 роки тому

      @@PhilippLackner oh I thought it is some kind of convention I didn't know about, Thanks for the info. always grateful to you Philipp