[DEV] Mobile Android and iPhone wallet app application Developments
-
I used Android studio to compile and feathercoinj from here:
https://github.com/wellenreiter01/feathercoinj
Feathercoin-Wallet for android is here in case you need it:
https://github.com/wellenreiter01/feathercoin-wallet-2
the test section is broken, so I compiled without-test
But I agree, setup and compile the first time is a pain… :-
-
Thanks for the pointers.
I’ll give that a shot!
:) -
OK Im compiled and im starting to look at what has to be done. Its quite a task. :)
Right in Block.java I have identified one placewe need to check the block number to either hash with scrypt ot neoscrypt.
it is in checkProofOfWork() (around line 600 or so) as at the moment it is always calling these methods
getScryptHash() and getScryptHashAsString()
rather than my new methods (cunningly named I think)
getNeoScryptHash() and getNeoScryptHashAsString() (genious lol)
So What I need is a way of either checking what the number of this block is or what the previous block is and all I can see is a hash of the pervious block? Any Ideas ?
-
Check wallet.java, line 1181.
The block object has a procedure ‘getHeight’ :)
Based on the height, you could add a flag to the call of checkProofOfWork() forcoing it to use getScryptHash() or getNeoScryptHash()
-
Perfect thanks wellenreiter :)
-
I used Android studio to compile and feathercoinj from here:
https://github.com/wellenreiter01/feathercoinj
Feathercoin-Wallet for android is here in case you need it:
https://github.com/wellenreiter01/feathercoin-wallet-2
the test section is broken, so I compiled without-test
But I agree, setup and compile the first time is a pain… :-
I have a problem for compile feathercoinj :
D:\FTC\andriod\feathercoinj-master>mvn clean package
[INFO] Scanning for projects…
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.google:feathercoinj-tools:[unknown-version] (D:\FTC\andriod\feathercoinj-master\tools\pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact com.google:feathercoinj-parent:pom:0.96-SNAPSHOT and ‘parent.relativePath’ points at wrong local
POM @ line 21, column 11 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException -
I still can complie it with eclipse include JNI code, but wallet.apk can not work after I install it. I don’t know any miss, Jar is a mess and It is frustrating. I think create a new project with eclipse 3.7.2, maven is a shit .
Android Runtime Info:
04-02 14:32:39.386: D/dalvikvm(618): Trying to load lib /data/data/com.feathercoin.wallet/lib/libneoscrypt.so 0x411eb378 04-02 14:32:39.386: D/dalvikvm(618): Added shared lib /data/data/com.feathercoin.wallet/lib/libneoscrypt.so 0x411eb378 04-02 14:32:39.386: D/dalvikvm(618): No JNI_OnLoad found in /data/data/com.feathercoin.wallet/lib/libneoscrypt.so 0x411eb378, skipping init 04-02 14:32:39.436: W/hasher(618): output: 04-02 14:32:39.606: D/dalvikvm(618): GC_CONCURRENT freed 217K, 7% free 10869K/11591K, paused 19ms+31ms, total 137ms 04-02 14:32:39.656: E/AbstractBlockChain(618): Failed to verify block: 04-02 14:32:39.656: E/AbstractBlockChain(618): com.google.feathercoin.core.VerificationException: Hash is higher than target: 2de0ecb2b7daa24fb9ef64fe0934508481bd14cf421c9d90f7b8e160a322850a vs ffff0000000000000000000000000000000000000000000000000000000 04-02 14:32:39.656: E/AbstractBlockChain(618): at com.google.feathercoin.core.Block.checkProofOfWork(Block.java:627) 04-02 14:32:39.656: E/AbstractBlockChain(618): at com.google.feathercoin.core.Block.verifyHeader(Block.java:748) 04-02 14:32:39.656: E/AbstractBlockChain(618): at com.google.feathercoin.core.AbstractBlockChain.add(AbstractBlockChain.java:405) 04-02 14:32:39.656: E/AbstractBlockChain(618): at com.google.feathercoin.core.AbstractBlockChain.add(AbstractBlockChain.java:289) 04-02 14:32:39.656: E/AbstractBlockChain(618): at com.google.feathercoin.core.Peer.processHeaders(Peer.java:365) 04-02 14:32:39.656: E/AbstractBlockChain(618): at com.google.feathercoin.core.Peer.processMessage(Peer.java:244) 04-02 14:32:39.656: E/AbstractBlockChain(618): at com.google.feathercoin.core.Peer.access$5(Peer.java:208) 04-02 14:32:39.656: E/AbstractBlockChain(618): at com.google.feathercoin.core.Peer$PeerHandler.messageReceived(Peer.java:1342) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:787) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:536) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:485) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:555) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) 04-02 14:32:39.656: E/AbstractBlockChain(618): at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) 04-02 14:32:39.656: E/AbstractBlockChain(618): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 04-02 14:32:39.656: E/AbstractBlockChain(618): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 04-02 14:32:39.656: E/AbstractBlockChain(618): at java.lang.Thread.run(Thread.java:856) 04-02 14:32:39.667: E/AbstractBlockChain(618): fdbe99b90c90bae7505796461471d89ae8388ab953997aa06a355bbda8d915cb 04-02 14:32:39.756: W/Peer(618): Block header verification failed 04-02 14:32:39.756: W/Peer(618): com.google.feathercoin.core.VerificationException: Could not verify block fdbe99b90c90bae7505796461471d89ae8388ab953997aa06a355bbda8d915cb 04-02 14:32:39.756: W/Peer(618): v1 block: 04-02 14:32:39.756: W/Peer(618): previous block: 12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2 04-02 14:32:39.756: W/Peer(618): merkle root: 808267d4d2e63c1098b4caa198eebd8096b912164efa0afeb8fdee31d726a925 04-02 14:32:39.756: W/Peer(618): time: [1366147060] Tue Apr 16 21:17:40 GMT 2013 04-02 14:32:39.756: W/Peer(618): difficulty target (nBits): 504365040 04-02 14:32:39.756: W/Peer(618): nonce: 3863023104 04-02 14:32:39.756: W/Peer(618): at com.google.feathercoin.core.AbstractBlockChain.add(AbstractBlockChain.java:299) 04-02 14:32:39.756: W/Peer(618): at com.google.feathercoin.core.Peer.processHeaders(Peer.java:365) 04-02 14:32:39.756: W/Peer(618): at com.google.feathercoin.core.Peer.processMessage(Peer.java:244) 04-02 14:32:39.756: W/Peer(618): at com.google.feathercoin.core.Peer.access$5(Peer.java:208) 04-02 14:32:39.756: W/Peer(618): at com.google.feathercoin.core.Peer$PeerHandler.messageReceived(Peer.java:1342) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:88) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:787) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:296) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:462) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:536) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:485) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:560) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:555) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:107) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:312) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:88) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) 04-02 14:32:39.756: W/Peer(618): at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) 04-02 14:32:39.756: W/Peer(618): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 04-02 14:32:39.756: W/Peer(618): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 04-02 14:32:39.756: W/Peer(618): at java.lang.Thread.run(Thread.java:856) 04-02 14:32:39.756: W/Peer(618): Caused by: com.google.feathercoin.core.VerificationException: Hash is higher than target: 2de0ecb2b7daa24fb9ef64fe0934508481bd14cf421c9d90f7b8e160a322850a vs ffff0000000000000000000000000000000000000000000000000000000 04-02 14:32:39.756: W/Peer(618): at com.google.feathercoin.core.Block.checkProofOfWork(Block.java:627) 04-02 14:32:39.756: W/Peer(618): at com.google.feathercoin.core.Block.verifyHeader(Block.java:748) 04-02 14:32:39.756: W/Peer(618): at com.google.feathercoin.core.AbstractBlockChain.add(AbstractBlockChain.java:405) 04-02 14:32:39.756: W/Peer(618): at com.google.feathercoin.core.AbstractBlockChain.add(AbstractBlockChain.java:289) 04-02 14:32:39.756: W/Peer(618): ... 26 more 04-02 14:33:01.636: W/hasher(618): output: 04-02 14:33:01.826: W/AbstractBlockChain(618): Block does not connect: 942650fccdbc157c05aab9f03e258b8dfe96c25997fa578aaa5904ab64c9d99a prev 79a0d95baf57d91f5d1e99ef2a01ce06b69b62849640b54208be2255ec50dbb1 04-02 14:33:01.826: I/Peer(618): Did not start chain download on solved block due to in-flight header download. 04-02 14:33:12.566: W/hasher(618): output: 04-02 14:33:12.716: W/AbstractBlockChain(618): Block does not connect: 62d7ba0eb0e9006e6e1f6de9652110ec1e3f941089be3af05aec31603da7eeb4 prev 942650fccdbc157c05aab9f03e258b8dfe96c25997fa578aaa5904ab64c9d99a 04-02 14:33:12.726: I/Peer(618): Did not start chain download on solved block due to in-flight header download.
-
The Jan post is relating to the wrong project version 0.9.6 being in the pom it needs to be whatever your project version is? 0.9.7.
Anyway im not sure about the second one. Wellenreiter did you check in all the working code into github? I had some major issues compiling feathercoinj also.
Any tips on how you got that bad boy running wellenreiter?
Are you running this on Linux or android lizhi? As I’m guessing the .so lib may only work with android?
-
I always use windows :) . OK , Let us check what happened in Wellenreiter’s code world .
Wellenreiter give a wallet.apk, It’s very good and work right. I use it sync all block. so I git his codes from github. then I spent two weeks to set up project with great Eclipse.
Now , I build feathercoinj.jar and wallet.apk , Unfortunately wallet can not work. It cann’t sync data.
This is my feathercoinj project in eclipse. I set it as android project . I build neoscrypt’s JNI code successful ,make libneoscrypt.so right. final I export it as feathercoinj.jar .
OK , I start step two. Set up wallet project, It is android project too and add feathercoinj.jar into jar’s build path. copy libneoscrypt.so and libscrypt.so into libs directory . I can start it in VM and export it as APK. I can make a wallet.apk.
Why my android wallet can not work ?
1. I think Wellenreiter’s code is right at least on his local computer, Because he gave me a new wallet.apk and It work right in my telephone.
2. There are 2 possible mistakes.
-
Some codes still are in Wellenreiter’s local computer ,not git push.
-
Some project’s setting are mistakes. unzip Wellenreiter’s wallet.apk , I don’t find lib\libneoscrypt.so , only libscrypt.so is in here.
-
-
I’ve checked, and according to ‘git status’ the files on my pc and the files on github are in sync.
I also checked my .gitignore and I load everything, but my project settings and the c- libraries to github.
For my environment:
I use Android Studio as development environment, which is a plugin to eclipse.
Initially I simply imported the original maven project into android studio, but did not convert it to graddle.
It took me weeks to get the dependencies and libraries used to compile the wallet right, so I try not to touch my settings anymore.
Next step for me is to install the development environment on another computer, clone the repository from github and tr to get an apk compiled.
When this is done I will update the readme file on github to reflect that setup, as maven doesn’t work for the project anymore.