@Override public void onAttach(final Activity activity) { super.onAttach(activity); this.activity = (AbstractBindServiceActivity) activity; this.application = (WalletApplication) activity.getApplication(); this.config = application.getConfiguration(); this.wallet = application.getWallet(); this.loaderManager = getLoaderManager(); this.nfcManager = (NfcManager) activity.getSystemService(Context.NFC_SERVICE); this.clipboardManager = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE); this.bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); }
private byte[] determinePaymentRequest(final boolean includeBluetoothMac) { final Address address = application.determineSelectedAddress(); final BigInteger amount = amountCalculatorLink.getAmount(); return PaymentProtocol.createPaymentRequest( amount, address, null, includeBluetoothMac && bluetoothMac != null ? "bt:" + bluetoothMac : null) .toByteArray(); }
private String determineBitcoinRequestStr(final boolean includeBluetoothMac) { final Address address = application.determineSelectedAddress(); final BigInteger amount = amountCalculatorLink.getAmount(); final StringBuilder uri = new StringBuilder(BitcoinURI.convertToBitcoinURI(address, amount, null, null)); if (includeBluetoothMac && bluetoothMac != null) { uri.append(amount == null ? '?' : '&'); uri.append(Bluetooth.MAC_URI_PARAM).append('=').append(bluetoothMac); } return uri.toString(); }