How to create a model on Android?

0

About this response this question , I asked the question of the answer author

  

If he chooses to store in an Array of Objects, this   question had an image what could be done.

His response

  

You can create a template called Pergunta , for example, and have a   object Bitmap (or any other typing of your image) within the   model. Then just create a List<Pergunta>

The question is what would be the model and how to create it?

    
asked by anonymous 11.02.2016 / 01:22

1 answer

3

This template is a normal class, it groups the information of whatever you want, in this case Bitmap for example.

It's basically the idea of object orientation.

public class Pergunta {

    private String nome;
    private Bitmap imagem;

    public Pergunta() {
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public Bitmap getImagem() {
        return imagem;
    }

    public void setImagem(Bitmap imagem) {
        this.imagem = imagem;
    }
}
    
11.02.2016 / 14:26