Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
It is possible to upload List<Class> to firebase Realtime database

I have a Simple class named Questions which contain :

public class Questions {
String question,correctAns;
String[] incorretAns;

public Questions() {
}

public Questions(String question, String correctAns, String[] incorretAns) {
    this.question = question;
    this.correctAns = correctAns;
    this.incorretAns = incorretAns;
}

public String getQuestion() {
    return question;
}

public void setQuestion(String question) {
    this.question = question;
}

public String getCorrectAns() {
    return correctAns;
}

public void setCorrectAns(String correctAns) {
    this.correctAns = correctAns;
}

public String[] getIncorretAns() {
    return incorretAns;
}

public void setIncorretAns(String[] incorretAns) {
    this.incorretAns = incorretAns;
}

}

and I want to upload it as a List<Questions> questionsList list to firebase real-time database it is possible to upload!.

I have tried to upload it but the firebase real-time database gives an exception: something like this:

FirebaseDatabase.getInstance().getReference().child("Questions")
                        .child("randomID")
                        .setValue(questionsList);

And it gives Exception like this:

com.google.firebase.database.DatabaseException: Serializing Arrays is not supported, please 
use Lists instead

And there is any other way to upload this type of data any help will be appreciated!

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You have used String[] incorretAns; that's why you are getting this expectation:

com.google.firebase.database.DatabaseException: Serializing Arrays is not 
supported, please 
use Lists instead

So instead of String[] incorretAns you can use options individually like:

String OptionA, OptionB, OptionC //or whatever you like

then you will not receive any errors I hope it helps you!

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!