Bitcoin Forum
June 22, 2024, 11:20:49 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Trying to build an android app that can send bitcoins, possibly store.  (Read 1469 times)
weather b0y4 (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 0


View Profile
October 28, 2014, 11:51:51 PM
 #1

Hello everyone! I am relatively new to programming and am trying to teach myself how to build a simple android app. I am building my app using eclipse Kepler, and one of the the last things I need to do is to allow my app to spend bitcoins. The first thing I did was turn my android application project into a maven android application project so I could use more resources. (Am i saying this right? I just needed to be able to import bitcoinj so i downloaded maven and maven 2 eclipse, then added some dependencies)

First, I read that I can integrate my app with an existing wallet, such as coinbases or the schildbach bitcoin-wallet (https://github.com/schildbach/bitcoin-wallet) so I can spend bitcoin out of this wallet by pressing a button in my app, but I cannot figure out how to do this. I tried to follow the sample-android-integration project for the schildbach wallet:

My best guess is to include the following in my pom.xml file, which based on my knowledge should work:

<parent>
   <groupId>de.schildbach.wallet</groupId>
   <artifactId>base</artifactId>
   <version>1</version>
</parent>

<dependency>
         <groupId>de.schildbach.wallet</groupId>
         <artifactId>integration-android</artifactId>
         <version>2.0</version>
</dependency>

When I put the <parent> in my pom.xml file, i get the error "Non-resolvable parent POM". Do I even need this?

When i put the dependency in my pom.xml file I get plenty of errors, such as failed to read artifact descriptor, failed to transfer de.schildbach-wallet:integration... , and 26 missing artifact errors. I am getting "Missing artifact:com.google:bitcoinj:jar:0.11.1" Even though under my project in the maven dependencies section i see bitcoin-0.11.1.jar. Does anyone have any idea what I am doing wrong here?

The way I understand it, if I am "depending" on this artifact, I should be able to use the methods in it as part of my project. How far off from the truth am I? Am i doing anything right?



So, after failing at this for a while, I decided I would try to make my own simple wallet using bitcoinj. I just want to create a wallet I can load with a few $ of bitcoin and be able to send the coins to a specified address.

I have been able to create addresses and a wallet, but I need to save the wallet. However when I run the method wallet.saveToFile(File f) I get the following errors:

log4j:WARN No appenders could be found for logger (com.google.bitcoin.core.Wallet).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "main" java.lang.NoSuchMethodError: org.bitcoinj.wallet.Protos$Key$Builder.setPrivateKey(Lcom/google/protobuf/ByteString;)Lorg/bitcoinj/wallet/Protos$Key$Builder;
   at com.google.bitcoin.store.WalletProtobufSerializer.walletToProto(WalletProtobufSerializer.java:131)
   at com.google.bitcoin.store.WalletProtobufSerializer.writeWallet(WalletProtobufSerializer.java:94)
   at com.google.bitcoin.core.Wallet.saveToFileStream(Wallet.java:468)
   at com.google.bitcoin.core.Wallet.saveToFile(Wallet.java:303)
   at com.google.bitcoin.core.Wallet.saveToFile(Wallet.java:342)
   at Main.main(Main.java:55)

Under maven dependencies I have log4j-1.2.16.jar and slf4j-log4j12-1.6.4.jar. Besides setting up slf4j as a dependency, what else do i need to do to "iniatilize the log4j system properly".

And my final question, will this be a recurring theme? Will different objects/methods I use from bitcoinj require me to set up ever more dependencies and jars?


If anyone has any suggestions, can answer any questions, or can point me to some material i should read, I would be very grateful!!!!
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
October 29, 2014, 12:47:16 AM
 #2

You are too new to programming to be handling wallets. I think you should gain 1-2 years of programming experience before jumping on the bitcoin wallet train.

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
weather b0y4 (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 0


View Profile
October 29, 2014, 04:49:14 AM
 #3

Fair point, and I would be the first to agree with you that I am bad at programming.

However, the only reason I am remotely interested in computer programming is because of bitcoin, and for at least a couple years I have been hoping someone would build the very simple app I am trying to build, perhaps as just a small part of a larger wallet app. Some have come close, but none have hit the target exactly, per se, so I decided to try and build a prototype myself and see if anyone liked it. (And if not, who cares? At least I learned a little programming along the way)

I had thought that an easy way to boost adoption would have been to make it very easy for any arbitrary app to set up a way to do bitcoin transactions so that not every programmer had to build their own wallet. Perhaps I am mistaken? Or i am overlooking something very simple/making a dumb mistake?

In any event I would like some constructive feedback. I really do not want to build a wallet, but i need to use a wallet.
Maha.Crypto
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
December 01, 2017, 08:09:28 PM
 #4

Fair point, and I would be the first to agree with you that I am bad at programming.

However, the only reason I am remotely interested in computer programming is because of bitcoin, and for at least a couple years I have been hoping someone would build the very simple app I am trying to build, perhaps as just a small part of a larger wallet app. Some have come close, but none have hit the target exactly, per se, so I decided to try and build a prototype myself and see if anyone liked it. (And if not, who cares? At least I learned a little programming along the way)

I had thought that an easy way to boost adoption would have been to make it very easy for any arbitrary app to set up a way to do bitcoin transactions so that not every programmer had to build their own wallet. Perhaps I am mistaken? Or i am overlooking something very simple/making a dumb mistake?

In any event I would like some constructive feedback. I really do not want to build a wallet, but i need to use a wallet.

Hey,
Do you able to create android wallet?

rule144
Newbie
*
Offline Offline

Activity: 53
Merit: 0


View Profile
December 01, 2017, 08:17:13 PM
 #5

I found blockgeeks to be a good site for learning.  They have courses too still I think, although I've never done one.  Smiley
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!