Firebase : Serializing arrays is not supported
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I am trying to put an object to my firebase database but I am getting the following error saying Array serialization is not supported and I should use Lists instead.
I am a newbie here please help me
Here is the DataPojo object I am trying to put into firebase
public class DataPojo {
private String msg1;
private String msg2;
private String msg3;
private String msg4;
private String msg5;
private String msg6;
private String msg7;
private String msg8;
private String msg9;
private String msg10;
private String msg11;
private String name;
public DataPojo(){}
public DataPojo(String msg1, String msg2, String msg3, String msg4, String msg5, String msg6, String msg7, String msg8, String msg9, String msg10, String msg11, String name) {
this.msg1 = msg1;
this.msg2 = msg2;
this.msg3 = msg3;
this.msg4 = msg4;
this.msg5 = msg5;
this.msg6 = msg6;
this.msg7 = msg7;
this.msg8 = msg8;
this.msg9 = msg9;
this.msg10 = msg10;
this.msg11 = msg11;
this.name = name;
}
public String getMsg9() {
return msg9;
}
public void setMsg9(String msg9) {
this.msg9 = msg9;
}
public String getMsg10() {
return msg10;
}
public void setMsg10(String msg10) {
this.msg10 = msg10;
}
public void setMsg11(String msg11) {
this.msg11 = msg11;
}
public String getMsg11() {
return msg11;
}
public String getMsg1() {
return msg1;
}
public void setMsg1(String msg1) {
this.msg1 = msg1;
}
public String getMsg2() {
return msg2;
}
public void setMsg2(String msg2) {
this.msg2 = msg2;
}
public String getMsg3() {
return msg3;
}
public void setMsg3(String msg3) {
this.msg3 = msg3;
}
public String getMsg4() {
return msg4;
}
public void setMsg4(String msg4) {
this.msg4 = msg4;
}
public String getMsg5() {
return msg5;
}
public void setMsg5(String msg5) {
this.msg5 = msg5;
}
public String getMsg6() {
return msg6;
}
public void setMsg6(String msg6) {
this.msg6 = msg6;
}
public String getMsg7() {
return msg7;
}
public void setMsg7(String msg7) {
this.msg7 = msg7;
}
public String getMsg8() {
return msg8;
}
public void setMsg8(String msg8) {
this.msg8 = msg8;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMessages() {
String messages = new String[11];
messages[0] = msg1;
messages[1] = msg2;
messages[2] = msg3;
messages[3] = msg4;
messages[4] = msg5;
messages[5] = msg6;
messages[6] = msg7;
messages[7] = msg8;
messages[8] = msg9;
messages[9] = msg10;
messages[10] = msg11;
return messages;
}
}
Why is it giving me that error? is it because of the getMessages() method? I do not have an array field declared though.
java android
add a comment |
I am trying to put an object to my firebase database but I am getting the following error saying Array serialization is not supported and I should use Lists instead.
I am a newbie here please help me
Here is the DataPojo object I am trying to put into firebase
public class DataPojo {
private String msg1;
private String msg2;
private String msg3;
private String msg4;
private String msg5;
private String msg6;
private String msg7;
private String msg8;
private String msg9;
private String msg10;
private String msg11;
private String name;
public DataPojo(){}
public DataPojo(String msg1, String msg2, String msg3, String msg4, String msg5, String msg6, String msg7, String msg8, String msg9, String msg10, String msg11, String name) {
this.msg1 = msg1;
this.msg2 = msg2;
this.msg3 = msg3;
this.msg4 = msg4;
this.msg5 = msg5;
this.msg6 = msg6;
this.msg7 = msg7;
this.msg8 = msg8;
this.msg9 = msg9;
this.msg10 = msg10;
this.msg11 = msg11;
this.name = name;
}
public String getMsg9() {
return msg9;
}
public void setMsg9(String msg9) {
this.msg9 = msg9;
}
public String getMsg10() {
return msg10;
}
public void setMsg10(String msg10) {
this.msg10 = msg10;
}
public void setMsg11(String msg11) {
this.msg11 = msg11;
}
public String getMsg11() {
return msg11;
}
public String getMsg1() {
return msg1;
}
public void setMsg1(String msg1) {
this.msg1 = msg1;
}
public String getMsg2() {
return msg2;
}
public void setMsg2(String msg2) {
this.msg2 = msg2;
}
public String getMsg3() {
return msg3;
}
public void setMsg3(String msg3) {
this.msg3 = msg3;
}
public String getMsg4() {
return msg4;
}
public void setMsg4(String msg4) {
this.msg4 = msg4;
}
public String getMsg5() {
return msg5;
}
public void setMsg5(String msg5) {
this.msg5 = msg5;
}
public String getMsg6() {
return msg6;
}
public void setMsg6(String msg6) {
this.msg6 = msg6;
}
public String getMsg7() {
return msg7;
}
public void setMsg7(String msg7) {
this.msg7 = msg7;
}
public String getMsg8() {
return msg8;
}
public void setMsg8(String msg8) {
this.msg8 = msg8;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMessages() {
String messages = new String[11];
messages[0] = msg1;
messages[1] = msg2;
messages[2] = msg3;
messages[3] = msg4;
messages[4] = msg5;
messages[5] = msg6;
messages[6] = msg7;
messages[7] = msg8;
messages[8] = msg9;
messages[9] = msg10;
messages[10] = msg11;
return messages;
}
}
Why is it giving me that error? is it because of the getMessages() method? I do not have an array field declared though.
java android
You have an array property declared, and why do you have so many individual fields anyway instead of just using an array or list?
– chrylis
Jan 3 at 2:32
Even thought it's just a temporary property? What's the workaround for this? And it's because I have to change them individually in my firebase database
– user10063142
Jan 3 at 2:37
There's no such thing as a "temporary property"--according to the JavaBeans standard, if there's agetFoo()
method, you have afoo
property.
– chrylis
Jan 3 at 2:38
Ok then, genius. So what do I do?
– user10063142
Jan 3 at 2:43
Use a List instead, like it says.ArrayList<String> messages = new ArrayList<>()
.
– TheWanderer
Jan 3 at 2:50
add a comment |
I am trying to put an object to my firebase database but I am getting the following error saying Array serialization is not supported and I should use Lists instead.
I am a newbie here please help me
Here is the DataPojo object I am trying to put into firebase
public class DataPojo {
private String msg1;
private String msg2;
private String msg3;
private String msg4;
private String msg5;
private String msg6;
private String msg7;
private String msg8;
private String msg9;
private String msg10;
private String msg11;
private String name;
public DataPojo(){}
public DataPojo(String msg1, String msg2, String msg3, String msg4, String msg5, String msg6, String msg7, String msg8, String msg9, String msg10, String msg11, String name) {
this.msg1 = msg1;
this.msg2 = msg2;
this.msg3 = msg3;
this.msg4 = msg4;
this.msg5 = msg5;
this.msg6 = msg6;
this.msg7 = msg7;
this.msg8 = msg8;
this.msg9 = msg9;
this.msg10 = msg10;
this.msg11 = msg11;
this.name = name;
}
public String getMsg9() {
return msg9;
}
public void setMsg9(String msg9) {
this.msg9 = msg9;
}
public String getMsg10() {
return msg10;
}
public void setMsg10(String msg10) {
this.msg10 = msg10;
}
public void setMsg11(String msg11) {
this.msg11 = msg11;
}
public String getMsg11() {
return msg11;
}
public String getMsg1() {
return msg1;
}
public void setMsg1(String msg1) {
this.msg1 = msg1;
}
public String getMsg2() {
return msg2;
}
public void setMsg2(String msg2) {
this.msg2 = msg2;
}
public String getMsg3() {
return msg3;
}
public void setMsg3(String msg3) {
this.msg3 = msg3;
}
public String getMsg4() {
return msg4;
}
public void setMsg4(String msg4) {
this.msg4 = msg4;
}
public String getMsg5() {
return msg5;
}
public void setMsg5(String msg5) {
this.msg5 = msg5;
}
public String getMsg6() {
return msg6;
}
public void setMsg6(String msg6) {
this.msg6 = msg6;
}
public String getMsg7() {
return msg7;
}
public void setMsg7(String msg7) {
this.msg7 = msg7;
}
public String getMsg8() {
return msg8;
}
public void setMsg8(String msg8) {
this.msg8 = msg8;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMessages() {
String messages = new String[11];
messages[0] = msg1;
messages[1] = msg2;
messages[2] = msg3;
messages[3] = msg4;
messages[4] = msg5;
messages[5] = msg6;
messages[6] = msg7;
messages[7] = msg8;
messages[8] = msg9;
messages[9] = msg10;
messages[10] = msg11;
return messages;
}
}
Why is it giving me that error? is it because of the getMessages() method? I do not have an array field declared though.
java android
I am trying to put an object to my firebase database but I am getting the following error saying Array serialization is not supported and I should use Lists instead.
I am a newbie here please help me
Here is the DataPojo object I am trying to put into firebase
public class DataPojo {
private String msg1;
private String msg2;
private String msg3;
private String msg4;
private String msg5;
private String msg6;
private String msg7;
private String msg8;
private String msg9;
private String msg10;
private String msg11;
private String name;
public DataPojo(){}
public DataPojo(String msg1, String msg2, String msg3, String msg4, String msg5, String msg6, String msg7, String msg8, String msg9, String msg10, String msg11, String name) {
this.msg1 = msg1;
this.msg2 = msg2;
this.msg3 = msg3;
this.msg4 = msg4;
this.msg5 = msg5;
this.msg6 = msg6;
this.msg7 = msg7;
this.msg8 = msg8;
this.msg9 = msg9;
this.msg10 = msg10;
this.msg11 = msg11;
this.name = name;
}
public String getMsg9() {
return msg9;
}
public void setMsg9(String msg9) {
this.msg9 = msg9;
}
public String getMsg10() {
return msg10;
}
public void setMsg10(String msg10) {
this.msg10 = msg10;
}
public void setMsg11(String msg11) {
this.msg11 = msg11;
}
public String getMsg11() {
return msg11;
}
public String getMsg1() {
return msg1;
}
public void setMsg1(String msg1) {
this.msg1 = msg1;
}
public String getMsg2() {
return msg2;
}
public void setMsg2(String msg2) {
this.msg2 = msg2;
}
public String getMsg3() {
return msg3;
}
public void setMsg3(String msg3) {
this.msg3 = msg3;
}
public String getMsg4() {
return msg4;
}
public void setMsg4(String msg4) {
this.msg4 = msg4;
}
public String getMsg5() {
return msg5;
}
public void setMsg5(String msg5) {
this.msg5 = msg5;
}
public String getMsg6() {
return msg6;
}
public void setMsg6(String msg6) {
this.msg6 = msg6;
}
public String getMsg7() {
return msg7;
}
public void setMsg7(String msg7) {
this.msg7 = msg7;
}
public String getMsg8() {
return msg8;
}
public void setMsg8(String msg8) {
this.msg8 = msg8;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMessages() {
String messages = new String[11];
messages[0] = msg1;
messages[1] = msg2;
messages[2] = msg3;
messages[3] = msg4;
messages[4] = msg5;
messages[5] = msg6;
messages[6] = msg7;
messages[7] = msg8;
messages[8] = msg9;
messages[9] = msg10;
messages[10] = msg11;
return messages;
}
}
Why is it giving me that error? is it because of the getMessages() method? I do not have an array field declared though.
java android
java android
asked Jan 3 at 2:31
user10063142user10063142
14
14
You have an array property declared, and why do you have so many individual fields anyway instead of just using an array or list?
– chrylis
Jan 3 at 2:32
Even thought it's just a temporary property? What's the workaround for this? And it's because I have to change them individually in my firebase database
– user10063142
Jan 3 at 2:37
There's no such thing as a "temporary property"--according to the JavaBeans standard, if there's agetFoo()
method, you have afoo
property.
– chrylis
Jan 3 at 2:38
Ok then, genius. So what do I do?
– user10063142
Jan 3 at 2:43
Use a List instead, like it says.ArrayList<String> messages = new ArrayList<>()
.
– TheWanderer
Jan 3 at 2:50
add a comment |
You have an array property declared, and why do you have so many individual fields anyway instead of just using an array or list?
– chrylis
Jan 3 at 2:32
Even thought it's just a temporary property? What's the workaround for this? And it's because I have to change them individually in my firebase database
– user10063142
Jan 3 at 2:37
There's no such thing as a "temporary property"--according to the JavaBeans standard, if there's agetFoo()
method, you have afoo
property.
– chrylis
Jan 3 at 2:38
Ok then, genius. So what do I do?
– user10063142
Jan 3 at 2:43
Use a List instead, like it says.ArrayList<String> messages = new ArrayList<>()
.
– TheWanderer
Jan 3 at 2:50
You have an array property declared, and why do you have so many individual fields anyway instead of just using an array or list?
– chrylis
Jan 3 at 2:32
You have an array property declared, and why do you have so many individual fields anyway instead of just using an array or list?
– chrylis
Jan 3 at 2:32
Even thought it's just a temporary property? What's the workaround for this? And it's because I have to change them individually in my firebase database
– user10063142
Jan 3 at 2:37
Even thought it's just a temporary property? What's the workaround for this? And it's because I have to change them individually in my firebase database
– user10063142
Jan 3 at 2:37
There's no such thing as a "temporary property"--according to the JavaBeans standard, if there's a
getFoo()
method, you have a foo
property.– chrylis
Jan 3 at 2:38
There's no such thing as a "temporary property"--according to the JavaBeans standard, if there's a
getFoo()
method, you have a foo
property.– chrylis
Jan 3 at 2:38
Ok then, genius. So what do I do?
– user10063142
Jan 3 at 2:43
Ok then, genius. So what do I do?
– user10063142
Jan 3 at 2:43
Use a List instead, like it says.
ArrayList<String> messages = new ArrayList<>()
.– TheWanderer
Jan 3 at 2:50
Use a List instead, like it says.
ArrayList<String> messages = new ArrayList<>()
.– TheWanderer
Jan 3 at 2:50
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54015599%2ffirebase-serializing-arrays-is-not-supported%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54015599%2ffirebase-serializing-arrays-is-not-supported%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You have an array property declared, and why do you have so many individual fields anyway instead of just using an array or list?
– chrylis
Jan 3 at 2:32
Even thought it's just a temporary property? What's the workaround for this? And it's because I have to change them individually in my firebase database
– user10063142
Jan 3 at 2:37
There's no such thing as a "temporary property"--according to the JavaBeans standard, if there's a
getFoo()
method, you have afoo
property.– chrylis
Jan 3 at 2:38
Ok then, genius. So what do I do?
– user10063142
Jan 3 at 2:43
Use a List instead, like it says.
ArrayList<String> messages = new ArrayList<>()
.– TheWanderer
Jan 3 at 2:50