Android Open Source - EZ-Wifi-Notification Messages






From Project

Back to project page EZ-Wifi-Notification.

License

The source code is released under:

GNU General Public License

If you think the Android project EZ-Wifi-Notification 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 et.nWifiManager.Message;
// www  . j  av  a2  s  . c o m
import et.nWifiManager.conState.ConnectionStatusEnum;


public class Messages {
  
  public static Message Wifi(String WifiName, String ssid, String ip, boolean flight, boolean short_title) {
    Message m = new Message();    
    if (ssid!="") {      
      m.setContentTitle("Wi-Fi"+ ((flight) ? " (Flight): " : ": ") + ssid);
    } else {
      if (flight) { m.setContentTitle("Wi-Fi (Flight Mode)"); } else {
      m.setContentTitle((!short_title) ? "Connected via Wi-Fi" : "Wi-Fi");}
    }
    if (ip!="") {
      m.setContentText(WifiName + " (" + ip + ")");
    } else {
      m.setContentText("Connected to " + WifiName);
    }
    m.setTickerText(m.getContentText());
    m.setState(ConnectionStatusEnum.Wifi);
    return m;    
  }
  
  public static Message Flight() {
    return new Message(ConnectionStatusEnum.Airplane, 
        "No connectivity","Flight Mode","No connectivity");
  }

  public static Message Mobile(boolean short_title) {
    return new Message(ConnectionStatusEnum.Mobile, (!short_title) ? "Connected via Mobile" : "Mobile");
  }

  public static Message Mobile(String ip, boolean short_title) {
    Message m = new Message();
    m.setContentTitle((!short_title) ? "Connected via Mobile" : "Mobile");
    if (ip!=null && ip!="") {
      m.setContentText("Mobile (" + ip + ")");
    } else {
      m.setContentText((!short_title) ? "Connected via Mobile" : "Mobile");
    }
    m.setTickerText(m.getContentText());
    m.setState(ConnectionStatusEnum.Mobile);
    return m;
  }
  
  public static Message NoConnectivity() {
    return new Message(ConnectionStatusEnum.Disconnected, "No network connection");
  }

  public static Message Unknown() {
    return new Message(ConnectionStatusEnum.Unsupported, "Unsupported Connection");
  }
  

  public static Message WiMax(boolean short_title) {
    return new Message(ConnectionStatusEnum.WiMax, (!short_title) ? "Connected via WIMAX" : "WIMAX");    
  }


  
}




Java Source Code List

et.nWifiManager.AnalyzeService.java
et.nWifiManager.ConnectivityBroadcastReceiver.java
et.nWifiManager.Constants.java
et.nWifiManager.Hardware.java
et.nWifiManager.LauncerActivity.java
et.nWifiManager.MyApplication.java
et.nWifiManager.PreferencesActivity.java
et.nWifiManager.Analyzers.AnalyzerInterface.java
et.nWifiManager.Analyzers.BrutalAnalyzer.java
et.nWifiManager.Analyzers.ContextWrapperIntentAnalyzerBase.java
et.nWifiManager.Analyzers.IntentAnalyzerInterface.java
et.nWifiManager.Analyzers.IntentAnalyzer.java
et.nWifiManager.Message.Message.java
et.nWifiManager.Message.Messages.java
et.nWifiManager.Notificators.NotificationSettings.java
et.nWifiManager.Notificators.Notificator.java
et.nWifiManager.Notificators.SystemNotificator.java
et.nWifiManager.conState.ConnectionStatusEnum.java