I met a problem while getting tron account info

I am developing tron mobile dapp with samsungblockchain.

I already created tron account using samsungblockchain wallet. But, the account I created on the wallet is not updated on my app. I get mAccountsList, but the lenght is 0.

I already tested aero wallet, and it is almost same code.


So, I should create new account. If I create account on my app, getAccount function shows my account address.

As a temporary soultion, I’m testing it by creating an address.

Why I can’t get the existed account info from samsungblockchain wallet?

@ReactMethod
public void getAccount(Promise successCallback) throws JSONException {
    mAccountsList = accountManager.getAccounts(hardwareWallet.getWalletId(),
            coinNetworkInfo.getCoinType(),
            coinNetworkInfo.getNetworkType());
    Gson g = new Gson();
    WritableArray array = new WritableNativeArray();
    for (Account co : mAccountsList) {
        JSONObject jo = new JSONObject(g.toJson(co));
        WritableMap wm = convertJsonToMap(jo);
        array.pushMap(wm);
    }
    successCallback.resolve(array);
}

@ReactMethod
public void createAccount(Promise promise) {
    ListenableFutureTask.Callback<Account> generatingNewAccountCallback =
            new ListenableFutureTask.Callback<Account>() {
                @Override
                public void onSuccess(Account account) {
                    Log.i("Cryptomission", "Generated account address: " + account.getAddress());
                }

Hello @wns1600000304,

Thank you for your interest in Samsung Blockchain Platform SDK. In order to use existing accounts on your application, you can use the restoreAccounts(…) API. To learn more please check out the programming guide from here.

PS: If you find this answer helpful please press the “like” button so that others can find it more easily.

Best Regards,
Shuvo
Samsung Developer Program