Android Open Source - wiigee_android_test Logger






From Project

Back to project page wiigee_android_test.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project wiigee_android_test 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 asus4.wiigeeandroid;
/*from  w  ww  .  j a v  a2 s. c  o  m*/
import java.util.Vector;

import android.util.Log;
import android.widget.TextView;

public class Logger {
  
  TextView textView;
  int maxLines;
  
  Vector<String> logs;
  
  public Logger(TextView textView, int maxLines) {
    this.textView = textView;
    this.maxLines = maxLines;
    
    logs = new Vector<String>();
  }
  
  public void addLog(String msg) {
    
    logs.add(msg);
    
    while(logs.size() > maxLines) {
      logs.remove(0);
    }
    
    Log.i("LOGGER", msg);
    
    textView.setText(toText());
  }
  
  public String toText() {
    StringBuilder sb = new StringBuilder();
    for(String msg : logs) {
      sb.append(msg);
      sb.append('\n');
    }
    return new String(sb);
  }

}




Java Source Code List

asus4.wiigeeandroid.Logger.java
asus4.wiigeeandroid.MainActivity.java
org.wiigee.control.AndroidWiigee.java
org.wiigee.control.Wiigee.java
org.wiigee.device.AndroidDevice.java
org.wiigee.device.Device.java
org.wiigee.event.AccelerationEvent.java
org.wiigee.event.AccelerationListener.java
org.wiigee.event.ActionStartEvent.java
org.wiigee.event.ActionStopEvent.java
org.wiigee.event.ButtonListener.java
org.wiigee.event.ButtonPressedEvent.java
org.wiigee.event.ButtonReleasedEvent.java
org.wiigee.event.GestureEvent.java
org.wiigee.event.GestureListener.java
org.wiigee.event.MotionStartEvent.java
org.wiigee.event.MotionStopEvent.java
org.wiigee.filter.DirectionalEquivalenceFilter.java
org.wiigee.filter.Filter.java
org.wiigee.filter.HighPassFilter.java
org.wiigee.filter.IdleStateFilter.java
org.wiigee.filter.LowPassFilter.java
org.wiigee.filter.MotionDetectFilter.java
org.wiigee.logic.Classifier.java
org.wiigee.logic.GestureModel.java
org.wiigee.logic.Gesture.java
org.wiigee.logic.HMM.java
org.wiigee.logic.PreciseHMM.java
org.wiigee.logic.ProcessingUnit.java
org.wiigee.logic.Quantizer.java
org.wiigee.logic.TriggeredProcessingUnit.java
org.wiigee.util.FileIO.java
org.wiigee.util.Log.java