web3-java

How to call the smart contract methods from android app using web3j

余生长醉 提交于 2019-12-24 18:18:26
问题 I want to call the smart contract methods from an Android app. I deployed the smart contract using truffle framework in my private network. I also created a wrapper class for the deployed smart contract using web3j commands. It creates a .java file in my Android project. I want to call smart contract methods from my Android app. This is my code: import android.net.Credentials; import android.renderscript.Type; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import

web3j not working with contract function?

旧时模样 提交于 2019-12-12 06:45:15
问题 This is my simple contract in my private network contract AB { /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; /* Initializes contract with initial supply tokens to the creator of the contract */ function AB () { balanceOf[msg.sender] = 1200; // Give the creator all initial tokens } /* Send coins */ function transfer(address _to, uint256 _value) { if (balanceOf[msg.sender] < _value) throw; // Check if the sender has enough if (balanceOf[_to] +