very simply I am following the web3j set up on the website, and when trying to get the latest version back to test it is connected to testrpc it throws a SocketException.
It says on the website that new HttpService() defaults to localhost:8545 which is what my testrpc is running on. I have also set the internet permission in the manifest.
//imports etc
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home_screen);
Web3j web3 = Web3jFactory.build(new HttpService());
try {
Web3ClientVersion clientVersion =
web3.web3ClientVersion().sendAsync().get(); //here is where thrown
String clientVers = clientVersion.getWeb3ClientVersion();
Log.d("hello", clientVers);
}
catch(InterruptedException e){
e.printStackTrace();
}
catch(ExecutionException e){
e.printStackTrace(); //throws as SocketException
}
}
//other code that has nothing to do with web3j
Sorry if this is obvious any help would be amazing. Thanks.