Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. ReLinker.recursively().loadLibrary(InitActivity.this, "JOpentxs");
  2. String otbinPath = OTWrapper.it(InitActivity.this).get_scripts_dir().getAbsolutePath();
  3. String walletDirPath = OTWrapper.it(InitActivity.this).get_wallet_dir().getAbsolutePath();
  4. OTWrapper.it(InitActivity.this).initOpenTxs(otbinPath, walletDirPath);
  5.  
  6.  
  7.  
  8.  
  9. public boolean initOpenTxs(String script_dir, String files_dir) {
  10.  
  11. if (!bInitialized_) {
  12. OTAPI_Wrap.SetAppBinaryFolder(script_dir); // Where the OT scripts are installed.
  13. OTAPI_Wrap.SetHomeFolder(files_dir); // Where the Mac desktop app would think of as your "OT home"
  14. try {
  15. if (false == OTAPI_Wrap.AppInit()) {
  16. Log.i("init_opentxs", "Failed calling AppInit.");
  17. return false;
  18. }
  19. }
  20. catch (Exception e) {
  21. e.printStackTrace();
  22. return false;
  23. }
  24.  
  25. OTAPI_Wrap.It();
  26. bInitialized_ = true;
  27. }
  28. // ----------------------------------
  29. if (!bWalletLoaded_ ) {
  30. setupPasswordCallback();
  31. setupAddressBookCallback();
  32. // ----------------------------------
  33. boolean bLoaded = OTAPI_Wrap.LoadWallet();
  34.  
  35. Log.i("init_opentxs", "OTAPI.LoadWallet: " + bLoaded);
  36.  
  37. recordList_ = new OTRecordList(new OTNameLookup());
  38.  
  39. Log.i("init_opentxs", "Recordlist size: " + recordList_.size());
  40.  
  41. bWalletLoaded_ = true;
  42. }
  43.  
  44. return true;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement