当前位置: 首页>>代码示例>>Java>>正文


Java BitcoinURI.convertToBitcoinURI方法代码示例

本文整理汇总了Java中org.bitcoinj.uri.BitcoinURI.convertToBitcoinURI方法的典型用法代码示例。如果您正苦于以下问题:Java BitcoinURI.convertToBitcoinURI方法的具体用法?Java BitcoinURI.convertToBitcoinURI怎么用?Java BitcoinURI.convertToBitcoinURI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bitcoinj.uri.BitcoinURI的用法示例。


在下文中一共展示了BitcoinURI.convertToBitcoinURI方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onLoadFinished

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
@Override
public void onLoadFinished(final Loader<Address> loader, final Address currentAddress) {
    if (!currentAddress.equals(currentAddressQrAddress)) {
        currentAddressQrAddress = new AddressAndLabel(currentAddress, config.getOwnName());

        final String addressStr = BitcoinURI.convertToBitcoinURI(currentAddressQrAddress.address, null,
                currentAddressQrAddress.label, null);

        currentAddressQrBitmap = new BitmapDrawable(getResources(), Qr.bitmap(addressStr));
        currentAddressQrBitmap.setFilterBitmap(false);

        currentAddressUriRef.set(addressStr);

        updateView();
    }
}
 
开发者ID:guodroid,项目名称:okwallet,代码行数:17,代码来源:WalletAddressFragment.java

示例2: showQrDialog

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
public void showQrDialog() {
    try {
        Address receiveAddress = walletServiceBinder.getCurrentReceiveAddress();
        String bitcoinUriStr = BitcoinURI.convertToBitcoinURI(receiveAddress, null, null, null);
        QrDialogFragment
                .newInstance(new BitcoinURI(bitcoinUriStr))
                .show(getFragmentManager(), "qr_dialog_fragment");
        Log.d(TAG, "showQrDialog - bitcoinUri" + bitcoinUriStr);
    } catch (Exception e) {
        Log.w(TAG, "Error showing QR Code: ", e);
        AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AlertDialogAccent);
        Dialog dialog = builder
                .setTitle(R.string.qr_code_error_title)
                .setMessage(getString(R.string.qr_code_error_message, e.getMessage()))
                .setNeutralButton(R.string.ok, null)
                .create();
        dialog.show();
    }
}
 
开发者ID:coinblesk,项目名称:coinblesk-client-gui,代码行数:20,代码来源:MainActivity.java

示例3: onLoadFinished

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
@Override
public void onLoadFinished(final Loader<Address> loader, final Address currentAddress)
{
    if (!currentAddress.equals(currentAddressQrAddress))
    {
        currentAddressQrAddress = new AddressAndLabel(currentAddress, config.getOwnName());

        final String addressStr = BitcoinURI.convertToBitcoinURI(currentAddressQrAddress.address, null, currentAddressQrAddress.label, null);

        final int size = getResources().getDimensionPixelSize(R.dimen.bitmap_dialog_qr_size);
        currentAddressQrBitmap = Qr.bitmap(addressStr, size);

        currentAddressUriRef.set(addressStr);

        updateView();
    }
}
 
开发者ID:soapboxsys,项目名称:ombuds-android,代码行数:18,代码来源:WalletAddressFragment.java

示例4: determineBitcoinRequestStr

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
private String determineBitcoinRequestStr(final boolean includeBluetoothMac) {
    final Coin amount = amountCalculatorLink.getAmount();
    final String ownName = config.getOwnName();

    final StringBuilder uri = new StringBuilder(BitcoinURI.convertToBitcoinURI(address, amount, ownName, null));
    if (includeBluetoothMac && bluetoothMac != null) {
        uri.append(amount == null && ownName == null ? '?' : '&');
        uri.append(Bluetooth.MAC_URI_PARAM).append('=').append(bluetoothMac);
    }
    return uri.toString();
}
 
开发者ID:guodroid,项目名称:okwallet,代码行数:12,代码来源:RequestCoinsFragment.java

示例5: bitcoinUriToString

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
public static String bitcoinUriToString(BitcoinURI bitcoinURI) {
    return BitcoinURI.convertToBitcoinURI(
            bitcoinURI.getAddress(),
            bitcoinURI.getAmount(),
            bitcoinURI.getLabel(),
            bitcoinURI.getMessage());
}
 
开发者ID:coinblesk,项目名称:coinblesk-client-gui,代码行数:8,代码来源:ClientUtils.java

示例6: copyToClipboard

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
private void copyToClipboard() {
    String uri = BitcoinURI.convertToBitcoinURI(
            bitcoinURI.getAddress(),
            bitcoinURI.getAmount(),
            bitcoinURI.getLabel(),
            bitcoinURI.getMessage());
    ClipData clip = ClipData.newPlainText("Address", uri);
    ClipboardManager clipboard = (ClipboardManager) getActivity()
            .getSystemService(Context.CLIPBOARD_SERVICE);
    clipboard.setPrimaryClip(clip);
}
 
开发者ID:coinblesk,项目名称:coinblesk-client-gui,代码行数:12,代码来源:QrDialogFragment.java

示例7: onItemClick

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
@Override
public void onItemClick(TimeLockedAddress item, int position) {
    try {
        Address address = item.getAddress(params);
        String uri = BitcoinURI.convertToBitcoinURI(address, null, null, null);
        BitcoinURI addressUri = new BitcoinURI(uri);
        QrDialogFragment
                .newInstance(addressUri)
                .show(getFragmentManager(), "address_qr_fragment");
    } catch (BitcoinURIParseException e) {
        Log.w(TAG, "Could not create bitcoin uri: ", e);
    }
}
 
开发者ID:coinblesk,项目名称:coinblesk-client-gui,代码行数:14,代码来源:WalletAddressList.java

示例8: determineBitcoinRequestStr

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
private String determineBitcoinRequestStr(final boolean includeBluetoothMac)
{
    final Coin amount = (Coin) btcAmountView.getAmount();
    final String ownName = config.getOwnName();

    final StringBuilder uri = new StringBuilder(BitcoinURI.convertToBitcoinURI(address, amount, ownName, null));
    if (includeBluetoothMac && bluetoothMac != null)
    {
        uri.append(amount == null && ownName == null ? '?' : '&');
        uri.append(Bluetooth.MAC_URI_PARAM).append('=').append(bluetoothMac);
    }
    return uri.toString();
}
 
开发者ID:soapboxsys,项目名称:ombuds-android,代码行数:14,代码来源:RequestCoinsFragment.java

示例9: paymentRequestURI

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
public String paymentRequestURI() throws AddressFormatException {
Address addr = new Address(Authenticator.getWalletOperation().getNetworkParams(), AddressBox.getValue().toString());
double amount = (double) Double.parseDouble(txReqAmount.getText())*100000000;
long satoshis = (long) amount;
Coin reqamount = Coin.valueOf(satoshis);
      return BitcoinURI.convertToBitcoinURI(addr, reqamount, txReqLabel.getText().toString(), txReqMemo.getText().toString());
  }
 
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:8,代码来源:Controller.java

示例10: uri

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
public String uri() {
    return BitcoinURI.convertToBitcoinURI(address.get(), null, Main.APP_NAME, null);
}
 
开发者ID:Techsoul192,项目名称:legendary-guide,代码行数:4,代码来源:ClickableBitcoinAddress.java

示例11: handleShowQr

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
private void handleShowQr(final String address, final String label) {
    final String uri = BitcoinURI.convertToBitcoinURI(Constants.NETWORK_PARAMETERS, address, null, label, null);
    BitmapFragment.show(getFragmentManager(), Qr.bitmap(uri));
}
 
开发者ID:guodroid,项目名称:okwallet,代码行数:5,代码来源:SendingAddressesFragment.java

示例12: handleShowQr

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
private void handleShowQr(final String address, final String label)
{
    final String uri = BitcoinURI.convertToBitcoinURI(address, null, label, null);
    final int size = getResources().getDimensionPixelSize(R.dimen.bitmap_dialog_qr_size);
    BitmapFragment.show(getFragmentManager(), Qr.bitmap(uri, size));
}
 
开发者ID:soapboxsys,项目名称:ombuds-android,代码行数:7,代码来源:SendingAddressesFragment.java

示例13: getBitcoinURI

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
public static String getBitcoinURI(String address, Coin amount, String label) {
    return address != null ?
            BitcoinURI.convertToBitcoinURI(Address.fromBase58(BisqEnvironment.getParameters(),
                    address), amount, label, null) :
            "";
}
 
开发者ID:bisq-network,项目名称:exchange,代码行数:7,代码来源:GUIUtil.java

示例14: uri

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
public String uri() throws AddressFormatException {
Address addr = new Address(Authenticator.getWalletOperation().getNetworkParams(), AddressBox.getValue().toString());
      return BitcoinURI.convertToBitcoinURI(addr, null, Authenticator.getApplicationParams().getAppName(), null);
  }
 
开发者ID:BitcoinAuthenticator,项目名称:Wallet,代码行数:5,代码来源:Controller.java

示例15: getBip21URI

import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
/**
 * Returns a BIP21 payment request string.
 *
 * @return BIP21 payment request string
 */
String getBip21URI() {
    return BitcoinURI.convertToBitcoinURI(receiveAddress, Coin.valueOf(totalAmount), "PaymentService",
            "Thank you! :)");
}
 
开发者ID:IUNO-TDM,项目名称:PaymentService,代码行数:10,代码来源:BitcoinInvoice.java


注:本文中的org.bitcoinj.uri.BitcoinURI.convertToBitcoinURI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。