Android Open Source - SipgateInfo Account Info






From Project

Back to project page SipgateInfo.

License

The source code is released under:

GNU General Public License

If you think the Android project SipgateInfo 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 net.skweez.sipgate.model;
//from   w ww .java 2s .co  m
import java.util.List;
import java.util.Observable;

import net.skweez.sipgate.api.Price;
import net.skweez.sipgate.api.UserName;
import net.skweez.sipgate.api.UserUri;

/**
 * @author Florian Mutter
 * @author Michael Kanis
 */
public class AccountInfo extends Observable {

  private UserName userName;

  private UserUri defaultUserUri;

  private Price balance;

  public String getCustomerNumber() {
    if (getDefaultUserUri() != null)
      return getDefaultUserUri().getSipUri().getUserInfo();
    else
      return "";
  }

  public String getPhoneNumber() {
    if (getDefaultUserUri() != null)
      return getDefaultUserUri().getOutgoingNumber();
    else
      return "";
  }

  public UserUri getDefaultUserUri() {
    return defaultUserUri;
  }

  public void setDefaultUserUri(List<UserUri> uris) {
    for (int i = 0; i < uris.size(); i++) {
      if (uris.get(i).isDefaultUri())
        defaultUserUri = uris.get(i);
    }
    // if there is no default userUri, we use the first one in the array
    defaultUserUri = uris.get(0);
    setChanged();
  }

  public void setDefaultUserUri(UserUri uri) {
    defaultUserUri = uri;
  }

  public UserName getUserName() {
    return userName;
  }

  public void setUserName(UserName userName) {
    this.userName = userName;
    setChanged();
  }

  public Price getBalance() {
    return balance;
  }

  public void setBalance(Price balance) {
    this.balance = balance;
    setChanged();
  }
}




Java Source Code List

net.skweez.sipgate.CallUtils.java
net.skweez.sipgate.PreferencesAuthenticator.java
net.skweez.sipgate.SipgateApplication.java
net.skweez.sipgate.activity.AccountInfoAdapter.java
net.skweez.sipgate.activity.CallListAdapter.java
net.skweez.sipgate.activity.MainActivity.java
net.skweez.sipgate.activity.SetupActivity.java
net.skweez.sipgate.api.AuthenticationException.java
net.skweez.sipgate.api.Call.java
net.skweez.sipgate.api.ECallStatus.java
net.skweez.sipgate.api.ISipgateAPI.java
net.skweez.sipgate.api.Price.java
net.skweez.sipgate.api.SipgateException.java
net.skweez.sipgate.api.UserName.java
net.skweez.sipgate.api.UserUri.java
net.skweez.sipgate.api.xmlrpc.SipgateUriHelper.java
net.skweez.sipgate.api.xmlrpc.SipgateXmlRpcImpl.java
net.skweez.sipgate.db.DataSource.java
net.skweez.sipgate.db.DatabaseHelper.java
net.skweez.sipgate.model.AccountInfo.java
net.skweez.sipgate.service.QueryResultReceiver.java
net.skweez.sipgate.service.QueryService.java