I found this documentationQuerying the state of a smart contract. but i can't get resault,this is my code.
Web3j web3j = Web3jFactory.build(new HttpService(url)); List<Type> inputParameters = new ArrayList<>(); List<TypeReference<?>> outputParameters = new ArrayList<>(); Function function = new Function("getManufacturer", inputParameters, outputParameters); String functionEncoder = FunctionEncoder.encode(function); EthCall response = web3j.ethCall( Transaction.createEthCallTransaction(contractAddress, DefaultBlockParameterName.LATEST ).sendAsync().get(); List<Type> someType = FunctionReturnDecoder.decode(response.getValue(),function.getOutputParameters()); Iterator<Type> it = someType.iterator(); Type resault = someType.get(0); String a = resault.toString(); Log.d("MainActitity", a + "111");
someone know how to fix it.:)