AndroidWeb3jOOM解决详解-创新互联
在Android客户端使用Web3j创建钱包、导入钱包时都可能会产生OOM,相关issue在Github上已经有所提及: https://github.com/web3j/web3j/issues/299 。这个问题在Web3j 3.0版本以前是没有的,由于新版的Web3j使用spongycastle库替换了lambdaworks库,虽然在效率上提升了速度,但存在Android端的兼容性问题。
本项目代码地址: https://github.com/uncleleonfan/WalletOOM.git
创建钱包OOM解决
在创建钱包时,如果创建一个Full Wallet,则会导致OOM:
public void onCreateFullWallet(View view) { String filePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/full"; File file = new File(filePath); file.mkdirs(); try { WalletUtils.generateFullNewWalletFile("a12345678", file); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (NoSuchProviderException e) { e.printStackTrace(); } catch (InvalidAlgorithmParameterException e) { e.printStackTrace(); } catch (CipherException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } }
新闻名称:AndroidWeb3jOOM解决详解-创新互联
本文URL:http://ybzwz.com/article/dogjgp.html