Android Open Source - Crystal-Ball Crystal Ball






From Project

Back to project page Crystal-Ball.

License

The source code is released under:

MIT License

If you think the Android project Crystal-Ball 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 me.rdokollari.crystalball;
/*from  ww w. ja  v a2s  .  c  om*/
import java.util.Random;

public class CrystalBall {

  private String mAnswers[] = { "It is certain", "It is decidely so",
      "All signs say YES", "The stars are not aligned", "My replay is no",
      "It is doubtful", "Better not tell you now",
      "Concetrate and ask again", "Unable to answer now" };

  /**
   * 
   * @return a random generator answer.
   */
  public String getRandomAnswer() {

    // Randomly select one of the three answers: Yes, No, or Maybe
    Random randomGenerator = new Random(); // construct a new random generator

    return mAnswers[randomGenerator.nextInt(mAnswers.length)];
  }
}




Java Source Code List

me.rdokollari.crystalball.CrystalBall.java
me.rdokollari.crystalball.MainActivity.java
me.rdokollari.crystalball.ShakeDetector.java