Android Open Source - crystalball Crystal Ball






From Project

Back to project page crystalball.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project crystalball 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 com.es0329.crystalball;
/* ww  w.ja v  a2s .c  o m*/
import java.util.Random;

import android.content.Context;

public class CrystalBall {
  private String[] predictions;

  public CrystalBall(Context context) {
    predictions = context.getResources()
        .getStringArray(R.array.predictions);
  }

  public String makePrediction() {
    int randomIndex = new Random().nextInt(predictions.length);
    return predictions[randomIndex];
  }
}




Java Source Code List

com.es0329.crystalball.CrystalBall.java
com.es0329.crystalball.MainActivity.java
com.es0329.crystalball.ShakeDetector.java