Loading repository data…
Loading repository data…
zoeleesss / repository
Everything you need to know about how to make an Ethereum blockchain dapp on android using Solidity, Web3j, Infura, etc.
The folder contains solidity contracts
The folder contains Web3js implementation
Deployment
FishCore & GeneticConsole and rememeber to set the address of geneticConsole to fishcore.Gene Quality
$names = ['普通','稀有','卓越','史诗','神话','传说','超神','宇宙之主'];Image
##Soidity First
1. You need to write your own solidity source code.
2. Compile and Deploy your source code using `remix`
(Don't forget to record your contract address! )
##Autogenerate file
3. Now use your source code( contract.sol )to use `solc` and `web3j` command tool to generate a java file.
##Android
###dependencies
4. Add `compile ('org.web3j:core:3.3.1-android')` to app/build.gradle
###Testing
5. Write and run simple code like creating a wallet
##Done
Tools:
solc (Remeber to use npm install solc to get solc):
Example: solc MetaCoin.sol --bin --abi --optimize -o /Users/pro/Desktop
Format: solc <contract>.sol --bin --abi --optimize -o <output-dir>/
web3j:
Format: web3j solidity generate [--javaTypes|--solidityTypes] /path/to/<smart-contract>.bin /path/to/<smart-contract>.abi -o /path/to/src/main/java -p com.your.organisation.name
Error: Execution failed for task ': app: packageAllDebugClassesForMultiDex'. > Java.util.zip.ZipException: duplicate entry: bolts / AggregateException.class
Solution:
1.add multiDexEnabled true to defaultConfig in app/build.gradle. 2.add compile 'com.android.support:multidex:1.0.3' to dependecies in app/build.gradle.
java.lang.OutOfMemoryError: Failed to allocate a 268435468 byte allocation with 8050708 free bytes and 244MB until OOM
Solution:
String filename = WalletUtils.generateLightNewWalletFile(password,new File(filepath)); 👍
instead of String filename = WalletUtils.generateFullNewWalletFile(password,new File(filepath));String filename = WalletUtils.generateWalletFile(password,ecKeyPair,new File(filepath),false);👍
instead of String filename = WalletUtils.generateWalletFile(password,ecKeyPair,new File(filepath),true);javax.net.ssl.SSLException: Connection closed by peerEthereum : 0x94cba7B70800575a3A4BfFd3B195bE4CcF5f7AAd