本文整理汇总了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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
示例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());
}
示例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);
}
示例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);
}
}
示例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();
}
示例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());
}
示例10: uri
import org.bitcoinj.uri.BitcoinURI; //导入方法依赖的package包/类
public String uri() {
return BitcoinURI.convertToBitcoinURI(address.get(), null, Main.APP_NAME, null);
}
示例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));
}
示例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));
}
示例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) :
"";
}
示例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);
}
示例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! :)");
}