Android Open Source - MobileConnectTestApp Api






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  ww .  j  a  v  a 2  s  . com*/
import java.io.Serializable;
import java.util.HashMap;

import org.codehaus.jackson.annotate.JsonIgnore;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class Api implements Serializable {
  private static final long serialVersionUID = -7245260322532564148L;

  public Api() {
    
  }
  
  public Api (JSONObject jsonObject) throws JSONException {
    if (jsonObject!=null) {
      JSONArray linkArray=jsonObject.getJSONArray("link");
      if (linkArray!=null) {
        link=new Link[linkArray.length()];
        linkMap=new HashMap<String,String> ();
        for (int i=0; i<linkArray.length(); i++) {
          link[i]=new Link(linkArray.getJSONObject(i));
          linkMap.put(link[i].getRel(), link[i].getHref());
        }
      }
    }
  }
  
  Link[] link=null;
  public Link[] getLink() { return this.link; }
  public void setLink(Link[] link) {
    this.link=link;
    linkMap=new HashMap<String,String> ();
    if (link!=null) {
      for (Link l:link) {
        linkMap.put(l.getRel(), l.getHref());
      }
    }
  }
  
  HashMap<String,String> linkMap=null;
  @JsonIgnore
  public String getHref(String rel) { return (linkMap!=null&&rel!=null)?linkMap.get(rel):null; }

  public JSONObject toObject() throws JSONException {
    JSONObject obj=new JSONObject();
    if (link!=null) obj.put("link", link);
    return obj;
  }

  public String toString() {
    String rv=null;
    try {
      JSONObject obj = toObject();
      rv=obj.toString();
    } catch (JSONException e) {
    }
    return rv;
  }
  
}




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