Android Open Source - VoxPopuli-Android Question






From Project

Back to project page VoxPopuli-Android.

License

The source code is released under:

GNU General Public License

If you think the Android project VoxPopuli-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package fr.kyriog.android.voxpopuli.entity;
/*from ww  w .  j  a  v a2  s  . c o  m*/
import android.os.Parcel;
import android.os.Parcelable;

public class Question implements Parcelable {
  private final String question;
  private final String answerA;
  private final String answerB;
  private final String answerC;
  private int resultA;
  private int resultB;
  private int resultC;

  public Question(String question, String answerA, String answerB, String answerC) {
    this.question = question;
    this.answerA = answerA;
    this.answerB = answerB;
    this.answerC = answerC;
  }

  public String getQuestion() {
    return question;
  }

  public String getAnswerA() {
    return answerA;
  }

  public String getAnswerB() {
    return answerB;
  }

  public String getAnswerC() {
    return answerC;
  }

  public int getResultA() {
    return resultA;
  }

  public void setResultA(int resultA) {
    this.resultA = resultA;
  }

  public int getResultB() {
    return resultB;
  }

  public void setResultB(int resultB) {
    this.resultB = resultB;
  }

  public int getResultC() {
    return resultC;
  }

  public void setResultC(int resultC) {
    this.resultC = resultC;
  }

  @Override
  public int describeContents() {
    return 0;
  }

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    String[] strings = new String[] {
        question,
        answerA,
        answerB,
        answerC
    };
    dest.writeStringArray(strings);

    int[] results = new int[] {
        resultA,
        resultB,
        resultC
    };
    dest.writeIntArray(results);
  }

  public static final Parcelable.Creator<Question> CREATOR = new Parcelable.Creator<Question>() {
    @Override
    public Question createFromParcel(Parcel source) {
      return new Question(source);
    }

    @Override
    public Question[] newArray(int size) {
      return new Question[size];
    }
  };

  public Question(Parcel in) {
    String[] strings = new String[4];
    in.readStringArray(strings);
    question = strings[0];
    answerA = strings[1];
    answerB = strings[2];
    answerC = strings[3];

    int[] results = new int[3];
    in.readIntArray(results);
    resultA = results[0];
    resultB = results[1];
    resultC = results[2];
  }
}




Java Source Code List

fr.kyriog.android.voxpopuli.GameActivity.java
fr.kyriog.android.voxpopuli.HomeActivity.java
fr.kyriog.android.voxpopuli.LoginActivity.java
fr.kyriog.android.voxpopuli.adapter.HomeAdapter.java
fr.kyriog.android.voxpopuli.adapter.PlayerAdapter.java
fr.kyriog.android.voxpopuli.adapter.ResultPlayerAdapter.java
fr.kyriog.android.voxpopuli.adapter.VotedPlayerAdapter.java
fr.kyriog.android.voxpopuli.entity.Game.java
fr.kyriog.android.voxpopuli.entity.Player.java
fr.kyriog.android.voxpopuli.entity.Question.java
fr.kyriog.android.voxpopuli.handler.AvatarHandler.java
fr.kyriog.android.voxpopuli.handler.GameHandler.java
fr.kyriog.android.voxpopuli.handler.HomeHandler.java
fr.kyriog.android.voxpopuli.socketio.BaseCallback.java
fr.kyriog.android.voxpopuli.socketio.GameCallback.java
fr.kyriog.android.voxpopuli.socketio.HomeCallback.java
fr.kyriog.android.voxpopuli.thread.AvatarDownloader.java