Android Open Source - MobileConnectTestApp Discovery Startup Settings






From Project

Back to project page MobileConnectTestApp.

License

The source code is released under:

MIT License

If you think the Android project MobileConnectTestApp 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.gsma.android.xoperatorapidemo.discovery;
/*  w w w . j a va 2s.  c o  m*/
import java.util.ArrayList;


public enum DiscoveryStartupSettings {
  STARTUP_OPTION_MANUAL (0, "Manually Controlled Discovery"),
  STARTUP_OPTION_PASSIVE (1, "Discover If Possible"),
  STARTUP_OPTION_PREEMPTIVE (2, "Force Discovery");
  
  public static final int DEFAULT=STARTUP_OPTION_PASSIVE.getValue();
  
  private int value;
  private String label;
  
  static ArrayList<DiscoveryStartupSettings> presentationOrder=null;
  static String[] labels=null;
  
  DiscoveryStartupSettings(int value, String label) {
    this.value=value;
    this.label=label;
  }
  
  public int getValue() { 
    return this.value;
  }
  
  public String getLabel() {
    return this.label;
  }
  
  static {
    presentationOrder=new ArrayList<DiscoveryStartupSettings>();
    presentationOrder.add(STARTUP_OPTION_MANUAL);
    presentationOrder.add(STARTUP_OPTION_PASSIVE);
    presentationOrder.add(STARTUP_OPTION_PREEMPTIVE);
    labels=new String[presentationOrder.size()];
    for (int i=0; i<presentationOrder.size(); i++) {
      labels[i]=presentationOrder.get(i).getLabel();
    }
  }
  
  public static String[] getLabels() { return labels; }
  
  public static DiscoveryStartupSettings get(int index) { return presentationOrder.get(index); }
  
  public static DiscoveryStartupSettings getByValue(int value) {
    DiscoveryStartupSettings selected=STARTUP_OPTION_PASSIVE;
    if (value==STARTUP_OPTION_MANUAL.value) {
      selected=STARTUP_OPTION_MANUAL;
    } else if (value==STARTUP_OPTION_PASSIVE.value) {
      selected=STARTUP_OPTION_PASSIVE;
    } else if (value==STARTUP_OPTION_PREEMPTIVE.value) {
      selected=STARTUP_OPTION_PREEMPTIVE;
    }
    return selected;
  }

  public static int getIndexByValue(int startupOptionValue) {
    int index=0;
    boolean found=false;
    for (int i=0; i<presentationOrder.size() && !found; i++) {
      found=(startupOptionValue==presentationOrder.get(i).value);
      if (found) index=i;
    }
    return index;
  }

}




Java Source Code List

com.gsma.android.xoperatorapidemo.activity.MainActivity.java
com.gsma.android.xoperatorapidemo.activity.SettingsActivity.java
com.gsma.android.xoperatorapidemo.activity.discovery.ActiveDiscoveryTask.java
com.gsma.android.xoperatorapidemo.activity.discovery.DiscoveryProcessEndpoints.java
com.gsma.android.xoperatorapidemo.activity.discovery.DisplayDiscoveryWebsiteActivity.java
com.gsma.android.xoperatorapidemo.activity.discovery.PassiveDiscoveryTask.java
com.gsma.android.xoperatorapidemo.activity.discovery.ProcessDiscoveryToken.java
com.gsma.android.xoperatorapidemo.activity.identity.AuthorizationCompleteActivity.java
com.gsma.android.xoperatorapidemo.activity.identity.DisplayIdentityWebsiteActivity.java
com.gsma.android.xoperatorapidemo.activity.identity.OpenIDConnectAbstractActivity.java
com.gsma.android.xoperatorapidemo.activity.identity.RetrieveTokenTask.java
com.gsma.android.xoperatorapidemo.activity.identity.RetrieveUserinfoTask.java
com.gsma.android.xoperatorapidemo.discovery.Api.java
com.gsma.android.xoperatorapidemo.discovery.DeveloperOperatorSetting.java
com.gsma.android.xoperatorapidemo.discovery.DiscoveryData.java
com.gsma.android.xoperatorapidemo.discovery.DiscoveryDeveloperOperatorSettings.java
com.gsma.android.xoperatorapidemo.discovery.DiscoveryServingOperatorSettings.java
com.gsma.android.xoperatorapidemo.discovery.DiscoveryStartupSettings.java
com.gsma.android.xoperatorapidemo.discovery.LinkConstants.java
com.gsma.android.xoperatorapidemo.discovery.Link.java
com.gsma.android.xoperatorapidemo.discovery.Response.java
com.gsma.android.xoperatorapidemo.discovery.ServingOperatorSetting.java
com.gsma.android.xoperatorapidemo.identity.UserinfoAddress.java
com.gsma.android.xoperatorapidemo.identity.Userinfo.java
com.gsma.android.xoperatorapidemo.logo.LogoCacheItem.java
com.gsma.android.xoperatorapidemo.logo.LogoCache.java
com.gsma.android.xoperatorapidemo.logo.LogoLoaderTask.java
com.gsma.android.xoperatorapidemo.logo.LogoResponseArray.java
com.gsma.android.xoperatorapidemo.logo.LogoResponse.java
com.gsma.android.xoperatorapidemo.utils.HttpUtils.java
com.gsma.android.xoperatorapidemo.utils.JsonUtils.java
com.gsma.android.xoperatorapidemo.utils.KeyValuePair.java
com.gsma.android.xoperatorapidemo.utils.ParameterList.java
com.gsma.android.xoperatorapidemo.utils.PhoneState.java
com.gsma.android.xoperatorapidemo.utils.PhoneUtils.java
com.gsma.android.xoperatorapidemo.utils.PreferencesUtils.java