0

so, I have to use firebase remote config in a project for some clients, and I am using a key to store a value and the value is not like a String, etc... but rather an array. let's say that the value looks like this:

 
 [
      {
        "owner": "jon",
        "year": 2019
      },
      {
        "owner": "Alex",
        "versionCode": 2032
      },
      ...
 ]

how am I supposed to get the owner and year and save them in a list of Laptops with gson?

Laptops.java look like this btw:

public class Laptop() {
    private String owner;
    private int year;

    // constructor
    ...
    // getters and setters
    ...
}

The answer from this post: Can I declare an array to Firebase Remote config? kinda helped but the answer is in kotlin, and I think the syntax is not exactly the same in java Thanks in advance!

2
  • See this stackoverflow.com/questions/5314813/… replace "this.json" with your json string Commented Feb 2, 2021 at 18:44
  • @Elvis Hi, sorry for the late reply; it's just that I can't figure out what "this" is in that case? in the comments he says that "it's input json string" ? I don't really know what that means and I think the syntax for that may have changed since 2011? Commented Feb 4, 2021 at 12:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.