This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import java.util.Random; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package PACKAGE_NAME; | |
import java.util.Date; | |
class Comment { | |
private final Date timestamp; | |
private final String message; | |
public Comment(Date timestamp, String message) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EmailIntent { | |
public static void sendEmail(final Context context, final String mailTo, final String ccTo, final String subject, final String body) { | |
final WeakReference<Context> reference = new WeakReference<>(context); | |
String mailto = "mailto:" + mailTo + | |
"?cc=" + ccTo + | |
"&subject=" + Uri.encode(subject) + | |
"&body=" + Uri.encode(body); | |
Intent emailIntent = new Intent(Intent.ACTION_SENDTO); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by dhimandasgupta on 12/8/2015. | |
* | |
* A Complex Number class where the real and imaginary fields are both Rational | |
* Can add, subtract, multiply and divide | |
*/ | |
public class ComplexRational { | |
private Rational mReal; | |
private Rational mImaginary; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.hardware.Sensor; | |
import android.hardware.SensorEvent; | |
import android.hardware.SensorEventListener; | |
import android.hardware.SensorManager; | |
import android.view.Surface; | |
import android.view.WindowManager; | |
public class RotationSensorEventListener implements SensorEventListener { | |
public interface RotationSensorCallback { |