Android Open Source - final_project_android Alert






From Project

Back to project page final_project_android.

License

The source code is released under:

MIT License

If you think the Android project final_project_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 com.geminnu.hexagon;
//from w  ww  .j  a v  a 2 s .  c  o  m
import android.os.Parcel;
import android.os.Parcelable;

public class Alert implements Parcelable{
  private int mBiosensor;
  private double mMaxvalue;
  private double mMinvalue;
  
  public Alert(int sensor, double max, double min) {
    this.mBiosensor = sensor;
    this.mMaxvalue = max;
    this.mMinvalue = min;
  }
  
  public Alert(Parcel in) {
    this.mBiosensor = in.readInt();
    this.mMaxvalue = in.readDouble();
    this.mMinvalue = in.readDouble();
  }
  
  public String check(double current) {
    if(current >= mMinvalue && current <= mMaxvalue) {
      return "GOOD";
    }
    return "BAD";
  }
  
  public int getSensorId() {
    return mBiosensor;
  }

  @Override
  public int describeContents() {
    // TODO Auto-generated method stub
    return 0;
  }

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    // TODO Auto-generated method stub
    dest.writeInt(mBiosensor);
    dest.writeDouble(mMaxvalue);
    dest.writeDouble(mMinvalue);
  }
  
  public static final Parcelable.Creator<Alert> CREATOR= new Parcelable.Creator<Alert>() {

        @Override
        public Alert createFromParcel(Parcel in) {
                // TODO Auto-generated method stub
                return new Alert(in);  //using parcelable constructor
        }

        @Override
        public Alert[] newArray(int size) {
                // TODO Auto-generated method stub
                return new Alert[size];
        }
  };
}




Java Source Code List

com.geminnu.hexagon.Alert.java
com.geminnu.hexagon.ArduinoMessage.java
com.geminnu.hexagon.ArduinoParser.java
com.geminnu.hexagon.ArduinoReceiver.java
com.geminnu.hexagon.ArduinoService.java
com.geminnu.hexagon.ArduinoStatusEventListener.java
com.geminnu.hexagon.ArduinoStatusEvent.java
com.geminnu.hexagon.ArduinoStatusManager.java
com.geminnu.hexagon.ArduinoStatus.java
com.geminnu.hexagon.ArduinoTask.java
com.geminnu.hexagon.ArduinoTransmitter.java
com.geminnu.hexagon.BioSensorEventListener.java
com.geminnu.hexagon.BioSensorEvent.java
com.geminnu.hexagon.BioSensorListenerItem.java
com.geminnu.hexagon.BioSensorManagerService.java
com.geminnu.hexagon.BioSensor.java
com.geminnu.hexagon.Bluetooth.java
com.geminnu.hexagon.CoordinatorActionListener.java
com.geminnu.hexagon.Coordinator.java
com.geminnu.hexagon.MainActivity.java
com.geminnu.hexagon.MessageListener.java
com.geminnu.hexagon.MessageSender.java
com.geminnu.hexagon.MySQLiteHelper.java
com.geminnu.hexagon.Profile.java
com.geminnu.hexagon.Reading.java
com.geminnu.hexagon.Wifi.java