I was not able to find any tutorial or an example on manage data operation of Java sdk. I tried to build a sample using the Java API documentation. But it's too complicated. If anyone can show me how to do this I am really thankful. Sample code or if you can point out any tutorial or an example that would be fine also.

1 Answer 1


I'm not sure this is what you need but I have written some code for a Flutter plugin that might help to clear at least some things up: Check out this code snippet:

private SubmitTransactionResponse doManageData(final String seed, String name, String value) throws Exception {
        KeyPair keyPair = KeyPair.fromSecretSeed(seed);
        AccountResponse sourceAccount = server.accounts().account(keyPair.getAccountId());

        ManageDataOperation operation = new ManageDataOperation.Builder(name, value.getBytes())
        Transaction transaction = new Transaction.Builder(sourceAccount, network)
        try {
            SubmitTransactionResponse response = server.submitTransaction(transaction);
            LOGGER.info("manageData: SubmitTransactionResponse: \uD83D\uDC99 Success? : " + response.isSuccess() + " \uD83D\uDC99 ");
            Log.d(TAG, response.isSuccess() ? "manageData transaction is SUCCESSFUL" : "manageData transaction failed");
            return response;
        } catch (Exception e) {
            String msg = "Failed to manageData: ";
            LOGGER.severe(msg + e.getMessage());
            throw new Exception(msg, e);
  • Many thanks for your support. I have figured it out thanks to your code snippet. Now it's working.
    – dev222
    Commented Apr 5, 2020 at 5:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.