Android Open Source - bitfynd-wallet-android Address And Label

From Project

Back to project page bitfynd-wallet-android.


The source code is released under:

GNU General Public License

If you think the Android project bitfynd-wallet-android 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

 * Copyright 2013-2014 the original author or authors.
 */*ww  w.  j  a  v  a  2 s  .  c  o  m*/
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <>.

package de.schildbach.wallet.ui;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import org.bitcoinj.core.Address;
import org.bitcoinj.core.AddressFormatException;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.core.WrongNetworkException;

import android.os.Parcel;
import android.os.Parcelable;

 * @author Andreas Schildbach
public class AddressAndLabel implements Parcelable
  public final Address address;
  public final String label;

  public AddressAndLabel(@Nonnull final NetworkParameters addressParams, @Nonnull final String address, @Nullable final String label)
      throws WrongNetworkException, AddressFormatException
    this.address = new Address(addressParams, address);
    this.label = label;

  public int describeContents()
    return 0;

  public void writeToParcel(final Parcel dest, final int flags)


  public static final Parcelable.Creator<AddressAndLabel> CREATOR = new Parcelable.Creator<AddressAndLabel>()
    public AddressAndLabel createFromParcel(final Parcel in)
      return new AddressAndLabel(in);

    public AddressAndLabel[] newArray(final int size)
      return new AddressAndLabel[size];

  private AddressAndLabel(final Parcel in)
    final NetworkParameters addressParameters = (NetworkParameters) in.readSerializable();
    final byte[] addressHash = new byte[Address.LENGTH];
    address = new Address(addressParameters, addressHash);

    label = in.readString();

Java Source Code List