Android Open Source - bankomatinfos App Controller






From Project

Back to project page bankomatinfos.

License

The source code is released under:

GNU General Public License

If you think the Android project bankomatinfos 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 at.zweng.bankomatinfos;
/* w ww . ja  v  a2  s .  c  om*/
import static at.zweng.bankomatinfos.util.Utils.*;
import android.content.Context;
import at.zweng.bankomatinfos.model.CardInfo;

/**
 * Very simple dummy-style controller class of this app. At the moment simply
 * used to pass the reading result around..
 * 
 * @author Johannes Zweng <johannes@zweng.at>
 */
public class AppController {

  /**
   * singleton instance
   */
  private static volatile AppController _instance = null;

  private CardInfo _cardInfo;
  private StringBuilder _log;

  /**
   * Get singleton object
   * 
   * @param context
   * @return
   */
  public static synchronized AppController getInstance() {
    if (_instance == null) {
      _instance = new AppController();
    }
    return _instance;
  }

  /**
   * Private consructor
   * 
   * @param ctx
   */
  private AppController() {
    this._cardInfo = null;
    this._log = new StringBuilder();
  }

  /**
   * @return the _cardInfo
   */
  public CardInfo getCardInfo() {
    return _cardInfo;
  }

  /**
   * @return the _cardInfo
   */
  public CardInfo getCardInfoNullSafe(Context ctx) {
    if (_cardInfo == null) {
      return new CardInfo(ctx);
    }
    return _cardInfo;
  }

  /**
   * @param _cardInfo
   *            the _cardInfo to set
   */
  public void setCardInfo(CardInfo cardInfo) {
    this._cardInfo = cardInfo;
  }

  /**
   * Append line to log
   * 
   * @param msg
   */
  public void log(String msg) {
    _log.append(getFullTimestampString());
    _log.append(": ");
    _log.append(msg);
    _log.append("\n");
  }

  /**
   * @return full log
   */
  public String getLog() {
    return _log.toString();
  }

  /**
   * clear log
   */
  public void clearLog() {
    _log = new StringBuilder();
  }
}




Java Source Code List

at.zweng.bankomatinfos.AppController.java
at.zweng.bankomatinfos.exceptions.NoSmartCardException.java
at.zweng.bankomatinfos.exceptions.TlvParsingException.java
at.zweng.bankomatinfos.iso7816emv.BERTLV.java
at.zweng.bankomatinfos.iso7816emv.ByteArrayWrapper.java
at.zweng.bankomatinfos.iso7816emv.CPLC.java
at.zweng.bankomatinfos.iso7816emv.EMVTags.java
at.zweng.bankomatinfos.iso7816emv.EmvTag.java
at.zweng.bankomatinfos.iso7816emv.EmvUtils.java
at.zweng.bankomatinfos.iso7816emv.GPTags.java
at.zweng.bankomatinfos.iso7816emv.Iso3166CountryCodes.java
at.zweng.bankomatinfos.iso7816emv.Iso4217CurrencyCodes.java
at.zweng.bankomatinfos.iso7816emv.NfcBankomatCardReader.java
at.zweng.bankomatinfos.iso7816emv.TagAndValue.java
at.zweng.bankomatinfos.iso7816emv.TagImpl.java
at.zweng.bankomatinfos.iso7816emv.TagType.java
at.zweng.bankomatinfos.iso7816emv.TagValueType.java
at.zweng.bankomatinfos.model.AbstractTransactionLogEntry.java
at.zweng.bankomatinfos.model.CardInfo.java
at.zweng.bankomatinfos.model.EmvTransactionLogEntry.java
at.zweng.bankomatinfos.model.InfoKeyValuePair.java
at.zweng.bankomatinfos.model.QuickTransactionLogEntry.java
at.zweng.bankomatinfos.ui.AboutDialogFragment.java
at.zweng.bankomatinfos.ui.ChangelogDialogFragment.java
at.zweng.bankomatinfos.ui.ListAdapterEmvTransactions.java
at.zweng.bankomatinfos.ui.ListAdapterInfos.java
at.zweng.bankomatinfos.ui.ListAdapterQuickTransactions.java
at.zweng.bankomatinfos.ui.MainActivity.java
at.zweng.bankomatinfos.ui.NfcDisabledActivity.java
at.zweng.bankomatinfos.ui.ResultActivity.java
at.zweng.bankomatinfos.ui.ResultEmvTxListFragment.java
at.zweng.bankomatinfos.ui.ResultInfosListFragment.java
at.zweng.bankomatinfos.ui.ResultLogFragment.java
at.zweng.bankomatinfos.ui.ResultQuickTxListFragment.java
at.zweng.bankomatinfos.ui.SettingsActivity.java
at.zweng.bankomatinfos.util.ChangeLog.java
at.zweng.bankomatinfos.util.CustomAlertDialog.java
at.zweng.bankomatinfos.util.Utils.java