14 thoughts on “Firebase Android Example Application : Joke Poster Android Application

  • August 12, 2016 at 6:46 am
    Permalink

    help me i can’t sign in

    Google Sign In failed. 9001

    every thing is same your code.

    Reply
    • August 12, 2016 at 4:13 pm
      Permalink

      Hello Ji,
      1. Have you created a new firebase application in Firebase console by giving SHA-1 fingerprint ?
      2. Make sure you have put google-services.json in the ‘app’ folder of your android application. Please check your build.gradle files and AndroidManifest.xml file.
      3. Enable Google Sign-in in Auth tab of your firebase console.

      Reply
      • August 13, 2016 at 2:43 am
        Permalink

        thank you reply
        but everything check ..
        please check your source

        Reply
        • August 15, 2016 at 3:36 pm
          Permalink

          It might be because of corrupted SHA-1 fingerprint. What you can do is, delete your firebase project and create a new one by using a newly generated SHA-1 fingerprint. To generate SHA-1 fingerprint from Android Studio follow this link : https://chandruscm.wordpress.com/tag/how-to-obtain-sha1-signing-certificate-fingerprint-from-android-studio/
          If you dont want to delete your firebase project you can go to your firebase Project Settings in firebase console and add the newly generated SHA-1.
          Download a new google-services.json file and paste it into your android application’s “app/” directory.

          Reply
  • August 15, 2016 at 7:35 am
    Permalink

    In you signinactivity

    GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);

    result always returns false, what to do?

    Reply
    • August 15, 2016 at 3:35 pm
      Permalink

      I had similar issue few months back. It was because corrupted SHA-1 fingerprint. What i did was, I deleted my firebase project and created a new one by using a newly generated SHA-1 fingerprint. To generate SHA-1 fingerprint from Android Studio follow this link. .
      If you dont want to delete your firebase project you can go to your firebase project settings in firebase console and
      add the newly generated SHA-1.
      Download a new google-services.json file and paste it into your android application’s “app/” directory.

      Reply
      • August 15, 2016 at 4:55 pm
        Permalink

        Hi,
        Thanks
        I got a different SHA1 key by following your tutorial and it’s working

        but now problem is that I’m able to post a joke only in the first run, after that the result.inSuccess returns false; If I uninstall my app completely and run again then it’s working, but for the first time only

        Reply
  • October 3, 2016 at 10:28 am
    Permalink

    Hello ,
    I am getting the error like this…
    Failed to load module descriptor class: Didn’t find class “com.google.android.gms.dynamite.descriptors.com.google.firebase.auth.ModuleDescriptor” on path: DexPathList[[zip file “/data/app/hb.com.firebasejokeposter-2/base.apk”],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
    Tag Manager is not found and thus will not be used

    Reply
    • October 4, 2016 at 7:47 am
      Permalink

      Hello Dhaivat, Is this error affecting the applications’s behaviour? Also please update firebase sdk to 9.0.2. Also update Google Repository and Google Play Services, there is an update for them too.

      Reply
  • November 10, 2016 at 6:36 am
    Permalink

    How to bypass login screen once user has signed in. Everytime user opens app he has to click google sign in button

    Reply
    • November 13, 2016 at 3:54 am
      Permalink

      Solved this by redirecting to JokeActivity

      Reply
  • February 25, 2017 at 5:16 am
    Permalink

    You did a great job putting this together, It’s sad to see that the source is not working.
    Please help fix this.
    Genius work here btw

    Reply
    • March 2, 2017 at 1:57 am
      Permalink

      HI Peter, Thank you for your comment. Did you change google-services.json and try to run?
      In my local it is still working fine. I will push the code to github and give a link to it soon. Thank you.

      Reply
  • September 19, 2017 at 7:16 pm
    Permalink

    i’m new to android and firebase..can u plz explain how to add likes counter
    This is my coding……..

    mDatabaseLikes = FirebaseDatabase.getInstance().getReference().child(“Likes”);

    viewHolder.mLikesBtn.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {

    mProcessLikes = true;

    mDatabaseLikes.addValueEventListener(new ValueEventListener() {
    @Override
    public void onDataChange(DataSnapshot dataSnapshot) {

    if (mProcessLikes) {
    if (dataSnapshot.child(Post_key).hasChild(mAuth.getCurrentUser().getUid())) {

    mDatabaseLikes.child(Post_key).child(mAuth.getCurrentUser().getUid()).removeValue();

    mProcessLikes = false;

    } else {

    mDatabaseLikes.child(Post_key).child(mAuth.getCurrentUser().getUid()).setValue(“likes”);

    mProcessLikes = false;
    }

    }

    }

    @Override
    public void onCancelled(DatabaseError databaseError) {

    }
    });

    }
    });

    }
    };
    public static class BlogViewHolder extends RecyclerView.ViewHolder {

    View mView;

    ImageButton mLikesBtn;

    DatabaseReference mDatabaseLike;

    FirebaseAuth mAuth;

    public BlogViewHolder(View itemView) {
    super(itemView);

    mView = itemView;

    mLikesBtn = (ImageButton) mView.findViewById(R.id.LikeBtn);

    mDatabaseLike = FirebaseDatabase.getInstance().getReference().child(“Likes”);

    mAuth = FirebaseAuth.getInstance();

    mDatabaseLike.keepSynced(true);
    }

    public void setLikesBtn(final String Post_key) {

    mDatabaseLike.addValueEventListener(new ValueEventListener() {
    @Override
    public void onDataChange(DataSnapshot dataSnapshot) {

    if (dataSnapshot.child(Post_key).hasChild(mAuth.getCurrentUser().getUid())) {

    mLikesBtn.setImageResource(R.mipmap.ic_thumb_up_blue);

    } else {

    mLikesBtn.setImageResource(R.mipmap.ic_thumb_up);

    }

    }

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *