Android Open Source - android-uds Util






From Project

Back to project page android-uds.

License

The source code is released under:

MIT License

If you think the Android project android-uds 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 org.imazlwifu.uds;
/*from  w  ww .jav  a 2  s.c  o  m*/
import android.content.Context;
import android.widget.Toast;

public class Util {
  public static void shortToast( Context context, String text ) {
    Toast.makeText( context, text, Toast.LENGTH_SHORT ).show();
  }
  
  public static void longToast( Context context, String text ) {
    Toast.makeText( context, text, Toast.LENGTH_LONG ).show();
  }
  
  /**
   * clips the object id added in the method <code>onSensorChanged</code> of <code>MonitoredSensor</code>
   * @param s e.g. "Gyroscope Sensor@420912b8"
   * @return e.g. "Gyroscope Sensor"
   */
  public static String clipObjectID( String s ) {
    if( !s.contains( "@" ) )
      return s;
    else {
      int firstOccurrence = s.indexOf( "@" );
      
      return s.substring( 0, firstOccurrence );
    }
  }
}




Java Source Code List

org.imazlwifu.uds.DataService.java
org.imazlwifu.uds.LibConfig.java
org.imazlwifu.uds.PreferencesActivity.java
org.imazlwifu.uds.UDS.java
org.imazlwifu.uds.UIActivity.java
org.imazlwifu.uds.Util.java
org.imazlwifu.uds.ipc.AlarmReceiver.java
org.imazlwifu.uds.ipc.PublishingDataReceiver.java
org.imazlwifu.uds.ipc.ServiceStarter.java
org.imazlwifu.uds.ipc.ServiceTerminator.java
org.imazlwifu.uds.model.Battery.java
org.imazlwifu.uds.model.Monitorable.java
org.imazlwifu.uds.model.MonitoredSensor.java
org.imazlwifu.uds.rpc.DataPublisher.java
org.imazlwifu.uds.rpc.HTTPRemoteConnection.java
org.imazlwifu.uds.rpc.RemoteConnection.java