Android Open Source - formulize-android Connection Info






From Project

Back to project page formulize-android.

License

The source code is released under:

GNU General Public License

If you think the Android project formulize-android 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 ca.formulize.android.data;
//from  w w  w. j  a  v  a  2 s  .  c  om
import android.os.Parcel;
import android.os.Parcelable;

/**
 * This object stores the connection information that the application needs to
 * connect to a Formulize server.
 * 
 * @author timch326
 * 
 */
public class ConnectionInfo implements Parcelable {

  private String connectionURL;
  private String connectionName;
  private String username;
  private String password;

  public ConnectionInfo(String connectionURL, String connectionName) {
    this(connectionURL, connectionName, null, null);
  }

  public ConnectionInfo(String connectionURL, String connectionName,
      String username, String password) {
    this.setConnectionURL(connectionURL);
    this.setConnectionName(connectionName);
    this.setUsername(username);
    this.setPassword(password);
  }

  public String getConnectionURL() {
    return connectionURL;
  }

  public void setConnectionURL(String mConnectionURL) {
    this.connectionURL = mConnectionURL;
  }

  public String getConnectionName() {
    return connectionName;
  }

  public void setConnectionName(String mConnectionName) {
    this.connectionName = mConnectionName;
  }

  public String getUsername() {
    return username;
  }

  public void setUsername(String mUsername) {
    this.username = mUsername;
  }

  public String getPassword() {
    return password;
  }

  public void setPassword(String mPassword) {
    this.password = mPassword;
  }


  @Override
  public String toString() {
    return "Name: " + connectionName + ", URL: " + connectionURL
        + ", Username: " + username + ", Password: " + password;
  }

  /*
   * Implementation of the Parcelable interface below
   * @see android.os.Parcelable
   */
  
  @Override
  public int describeContents() {
    return 0;
  }

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    dest.writeStringArray(new String[] { this.connectionURL,
        this.connectionName, this.username, this.password });
  }

  // static field used to regenerate connection info from a parcel
  public static final Parcelable.Creator<ConnectionInfo> CREATOR = new Parcelable.Creator<ConnectionInfo>() {
    public ConnectionInfo createFromParcel(Parcel pc) {
      return new ConnectionInfo(pc);
    }

    @Override
    public ConnectionInfo[] newArray(int size) {
      return new ConnectionInfo[size];
    }
  };

  // Constructor used by CREATOR object to read data from parcel
  public ConnectionInfo(Parcel pc) {
    connectionURL = pc.readString();
    connectionName = pc.readString();
    username = pc.readString();
    password = pc.readString();
  }
}




Java Source Code List

ca.formulize.android.connection.FUserSession.java
ca.formulize.android.connection.LoginRunnable.java
ca.formulize.android.connection.LogoutAsyncTask.java
ca.formulize.android.connection.NetworkStateReceiver.java
ca.formulize.android.data.ConnectionInfo.java
ca.formulize.android.data.FormulizeApplication.java
ca.formulize.android.data.FormulizeDBContract.java
ca.formulize.android.data.FormulizeDBHelper.java
ca.formulize.android.data.FormulizeLink.java
ca.formulize.android.ui.AddConnectionActivity.java
ca.formulize.android.ui.ApplicationListActivity.java
ca.formulize.android.ui.ConnectionActivity.java
ca.formulize.android.ui.LoginDialogFragment.java
ca.formulize.android.ui.LogoutDialogFragment.java
ca.formulize.android.ui.NoNetworkDialogFragment.java
ca.formulize.android.ui.ScreenListActivity.java
ca.formulize.android.ui.ScreenWebActivity.java
ca.formulize.android.util.ConnectionUtil.java