O'Reilly logo

Mastering Firebase for Android Development by Ashok Kumar S

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Logic

The following POJO class expresses the idea and the data format that we will save in Firebase. Using the POJO class we will pass the data to the adapter:

package com.ashok.packt.realtime.database.model;/** * Created by ashok.kumar on 20/10/17. */public class Donor {    private String FullName;    private String Email;    private String City;    private String BloodGroup;    public Donor(){    }

Now within the same class lets create a constructor for passing the data to the POJO:

    public Donor(String fullName, String email, String city, String bloodGroup) {        FullName = fullName;        Email = email;        City = city;        BloodGroup = bloodGroup;    }    public String getFullName() {        return FullName;    }    public void setFullName(String fullName) {        FullName = fullName;    }    public ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required