This is what i got. IT fails to installl apk...

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.ProgressBar;
import org.bitcoinj.core.Context;
import org.bitcoinj.core.NetworkParameters;
import org.bitcoinj.core.listeners.DownloadProgressTracker;
import org.bitcoinj.kits.WalletAppKit;
import org.bitcoinj.params.TestNet3Params;

import java.io.File;
import java.util.Date;

public class MainActivity extends AppCompatActivity {

    public static NetworkParameters BTCparams = TestNet3Params.get();
    public static WalletAppKit BTCkit = new WalletAppKit(BTCparams,new 
File("."),"BTC-Test");
    private ProgressBar BTCProgress;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        BTCProgress = findViewById(R.id.BTCProgress);
        Context.propagate(new Context(BTCparams));
        DownloadProgressTracker BTCListener = new DownloadProgressTracker() {
            @Override
            public void progress(double pct, int blocksSoFar, Date date) {
                System.out.println("Syncing..."+pct+"%");
                BTCProgress.setProgress((int) pct);
            }
            @Override
            public void doneDownload() {
                System.out.println("Sync Done.");
                BTCProgress.setProgress(100);
            }
        };
        
BTCkit.setDownloadListener(BTCListener).setBlockingStartup(false).startAsync().awaitRunning();
    }
}


Unknown failure (at android.os.Binder.execTransact(Binder.java:697))
Error while Installing APKs

This is a pretty simple script and i know this code works in a normal java 
program.

On Thursday, November 15, 2018 at 2:44:26 AM UTC-5, Stephen Davis wrote:
>
> I can just give you some off the cuff instructions because the process is 
> intended to be very simple and clean.  
>
> You need to open your build.gradle file, but there are two, and the one 
> you are looking for specifically is the "(Module: app)" build.gradle file 
> which is usually the one under the first build.gradle file if you've 
> created a standard template application using android studio.  
>
> After you open that .gradle file, if you scroll all the way down to the 
> bottom, you'll see the function labelled "dependencies" which is where 
> you'll add your bitcoinj dependency.  Somewhere in that function, doesn't 
> matter where, add this line to your project 
> implementation 'org.bitcoinj:bitcoinj-core:0.14.7'  
> android studio will prompt you to re-sync your project which you need to 
> do.  
> That's it.  Your dependency was added and you can begin using it.  And you 
> shouldn't see that error anymore either.
>
> On another note, not to make things too complicated off the bat, but if 
> you are trying to push a project to the app store, you need to omit the 
> scrypt library that comes with bitcoinj as it contains some compiled c code 
> that will screw up your APK's.  Don't worry about this until you need to 
> though.
>
> On Thu, Nov 15, 2018 at 2:00 AM Bobby_Bouche <[email protected] 
> <javascript:>> wrote:
>
>> is there instructions? Im still new to gradle and unfamiliar as to how i 
>> can add the dependancy.
>>
>> On Thursday, November 15, 2018 at 1:06:59 AM UTC-5, Stephen Davis wrote:
>>>
>>> It works for me (relatively)
>>>
>>> Why don't you try importing it using the gradle dependency?  Seems to be 
>>> much easier than importing the .jar file
>>>
>>> On Thu, Nov 15, 2018 at 12:39 AM Bobby_Bouche <[email protected]> wrote:
>>>
>>>> is this usable for android?
>>>>
>>>> I am getting errors saying error: package org.bitcoinj.params does not 
>>>> exist.
>>>>
>>>> this is from a jar. i used it perfectly in my java application but when 
>>>> im doing the same for android studio im getting these errors.
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "bitcoinj" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "bitcoinj" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"bitcoinj" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to