<p>use an alternative library to me I like this gives you more flexibility and uses bitcoinj</p>

<p><a href="https://github.com/dogecoin/libdohj" rel="nofollow noreferrer">https://github.com/dogecoin/libdohj</a></p>

CC BY-SA 4.0
2018-08-30T06:24:56.073Z
I was trying to do this. please check my 2 days ago comment.
Sid009
CC BY-SA 4.0
2018-09-04T20:44:54.777Z
Using libdohj, I made a fork of https://github.com/bitcoin-wallet/bitcoin-wallet, The problem is that this library takes a long time to synchronize for mobiles and recovering a wallet takes a long time.

Another alternative would be to use https://github.com/Coinomi/coinomi-android for mobiles is lighter. The problem is that you have to mount an electrum server for litecoin https://github.com/pooler/electrum-ltc-server
Jose Luis Estevez
CC BY-SA 4.0
2018-08-30T04:41:30.673Z
2018-08-30T04:41:30.673Z
Jose Luis Estevez
<p>I've created a crypto-currency wallet for Bitcoin using BitcoinJ. Now I want to add Litecoin in this wallet. How to implement BitcoinJ dependency for Litecoin? 
While using BitcoinJ for both Litecoin and Bitcoin, I was getting blockchain of Bitcoin for both the addresses. What should I do so that I can get Bicoin blockchain for Bitcoin address and Litecoin blockchain for Litecoin address?</p>

<p>here is dependency which is I used>>></p>

<pre><code>  implementation 'org.bitcoinj:bitcoinj-core:0.14.7'
</code></pre>

<p>here is my code for bitcoin blockchain download initialisation>>></p>

<pre><code>  public void initWallet() {
    ECKey key;
    String btcpri = 
     "cxxxxxre75ENAnpGjUr8EEdP2kxtvk1r65nTydnM954n4WxxxxxM";
    if (btcpri.length() == 51 || btcpri.length() == 52) {
        DumpedPrivateKey dumpedPrivateKey = 
        DumpedPrivateKey.fromBase58(params, btcpri);
        key = dumpedPrivateKey.getKey();
    } else {
        BigInteger privKey = Base58.decodeToBigInteger(btcpri);
        key = ECKey.fromPrivate(privKey);
    }
    Log.e("key ", String.valueOf(key));
    setBtcSDKThread();
    BriefLogFormatter.init();

    kit = new WalletAppKit(params, file, "btc_justbitcoin") {
        @Override
        protected void onSetupCompleted() {
            wallet().importKey(key);
            setupWalletListeners(wallet());
            Log.e("Address ", 
            String.valueOf(wallet().freshReceiveAddress()));
        }
    };
    kit.setBlockingStartup(false);
    kit.startAsync();
    kit.awaitRunning();
 }
</code></pre>

CC BY-SA 4.0
2018-08-25T14:39:17.310Z
Can you show the definition of params variable? You will need to make a Litecoin version of the params so it has all of the Litecoin parameters. Then create another WalletAppKit using those new params.
JBaczuk
CC BY-SA 4.0
2018-08-25T14:45:11.043Z
See https://github.com/litecoin-project/litecoinj/blob/master/src/main/java/org/litecoinj/integrations/LitecoinNetParameters.java for an example.
JBaczuk
CC BY-SA 4.0
2018-08-26T13:14:51.870Z
here is my variable params is  **NetworkParameters params = TestNet3Params.get();**
Sid009
CC BY-SA 4.0
2018-08-27T05:43:39.240Z
**@JBaczuk** how to use this in android studio [https://github.com/litecoin-project/litecoinj/blob/master/pom.xml]
Sid009
CC BY-SA 4.0
2018-08-27T05:45:40.730Z
I was trying to use this dependancy but it didn't implement in my project   **implementation 'org.bitcoinj:bitcoinj-core:0.13-alice-SNAPSHOT'**
Sid009
CC BY-SA 4.0
2018-08-27T11:55:55.037Z
Hmm, not sure. Stack overflow is usually better for programming questions
JBaczuk
<litecoin><bitcoinj><android>
Issue with the BitcoinJ for Litecoin. Which dependency can be used for Litecoin?
Sid009
# Issue with the BitcoinJ for Litecoin. Which dependency can be used for Litecoin?

(Asked by: username_0 on 2018-08-25)

I've created a crypto-currency wallet for Bitcoin using BitcoinJ. Now I want to add Litecoin in this wallet. How to implement BitcoinJ dependency for Litecoin?
While using BitcoinJ for both Litecoin and Bitcoin, I was getting blockchain of Bitcoin for both the addresses. What should I do so that I can get Bicoin blockchain for Bitcoin address and Litecoin blockchain for Litecoin address?

here is dependency which is I used>>>

```
  implementation 'org.bitcoinj:bitcoinj-core:0.14.7'

```

here is my code for bitcoin blockchain download initialisation>>>

```
  public void initWallet() {
    ECKey key;
    String btcpri = 
     "cxxxxxre75ENAnpGjUr8EEdP2kxtvk1r65nTydnM954n4WxxxxxM";
    if (btcpri.length() == 51 || btcpri.length() == 52) {
        DumpedPrivateKey dumpedPrivateKey = 
        DumpedPrivateKey.fromBase58(params, btcpri);
        key = dumpedPrivateKey.getKey();
    } else {
        BigInteger privKey = Base58.decodeToBigInteger(btcpri);
        key = ECKey.fromPrivate(privKey);
    }
    Log.e("key ", String.valueOf(key));
    setBtcSDKThread();
    BriefLogFormatter.init();

    kit = new WalletAppKit(params, file, "btc_justbitcoin") {
        @Override
        protected void onSetupCompleted() {
            wallet().importKey(key);
            setupWalletListeners(wallet());
            Log.e("Address ", 
            String.valueOf(wallet().freshReceiveAddress()));
        }
    };
    kit.setBlockingStartup(false);
    kit.startAsync();
    kit.awaitRunning();
 }

```

**Tags:** litecoin, bitcoinj, android

> **Comments:**
> **username_1**: Can you show the definition of params variable? You will need to make a Litecoin version of the params so it has all of the Litecoin parameters. Then create another WalletAppKit using those new params.  
> **username_1**: See https://github.com/litecoin-project/litecoinj/blob/master/src/main/java/org/litecoinj/integrations/LitecoinNetParameters.java for an example.  
> **username_0**: here is my variable params is  **NetworkParameters params = TestNet3Params.get();**  
> **username_0**: **@username_1** how to use this in android studio [https://github.com/litecoin-project/litecoinj/blob/master/pom.xml]  
> **username_0**: I was trying to use this dependancy but it didn't implement in my project   **implementation 'org.bitcoinj:bitcoinj-core:0.13-alice-SNAPSHOT'**  
> **username_1**: Hmm, not sure. Stack overflow is usually better for programming questions  

---

## 1 answers

### Answer by username_2 on 2018-08-30. Score: 0

use an alternative library to me I like this gives you more flexibility and uses bitcoinj

<https://github.com/dogecoin/libdohj>

> **Comments:**
> **username_0**: I was trying to do this. please check my 2 days ago comment.  
> **username_2**: Using libdohj, I made a fork of https://github.com/bitcoin-wallet/bitcoin-wallet, The problem is that this library takes a long time to synchronize for mobiles and recovering a wallet takes a long time.  Another alternative would be to use https://github.com/Coinomi/coinomi-android for mobiles is lighter. The problem is that you have to mount an electrum server for litecoin https://github.com/pooler/electrum-ltc-server  

---

