subashpoudel

Why is FormField class in android package public?

0 votes
I am following the EsignLive demo tutorial given by Michael Williams for ios here https://www.youtube.com/watch?v=mnhyEY7WQzw. I am working on android and I have thought of implementing EsignLive in similar fashion. Requirement: Pre populate the pdf form with signer's details and other relevant data that we fetch from our api. This is important for us as we have a good number of documents and many fields are to be populated. Doing it manually is tiresome. In the tutorial, Michael uses ESFormField in his xcode project which is public for ios so he is able to instantiate it in the viewcontroller. Similar class FormField is available in android but it is package public so I cannot instantiate it from application code. How can I achieve similar result using android sdk? Any samples for this is highly appreciated. Android Studio issue

Reply to: Why is FormField class in android package public?

0 votes
Hi there, Did you have a look at the sample application that comes with the Android SDK?
Haris Haidary OneSpan Technical Consultant

Reply to: Why is FormField class in android package public?

1 votes
As per our mobile dev team, we are using CreateTransactionViewModel to build a transaction. The data structure and the objects are more similar to the data structure used in eSignLive REST API. There is sample code into the sample app:
private void createLocalTransaction() {


    try {
        Transaction transaction = CreateTransactionViewModel.createTransaction("Locally created transaction");

        CreateTransactionViewModel.setInPersonSigning(transaction.getId(),true);

        Role role = CreateTransactionViewModel.addRole(transaction.getId(),"Test","Signer","[email protected]","ACME",null);
        CreateTransactionViewModel.addRole(transaction.getId(),"Reviewer","Test","[email protected]","ACME",null);

        Approval approval = new Approval(null,role.getId());
        FormField signature = new Signature(null, Signature.Type.CAPTURE_SIGNATURE, 0, 320, 350, 200,50);
        approval.addField(signature);
        List approvalsList = new ArrayList();
        approvalsList.add(approval);



        Uri docUri = moveAssetToHomeFolderIfNeeded("SampleDocument.pdf");
        if (docUri == null) {
            Log.e("APP","Doc not found");
            return;
        }


        CreateTransactionViewModel.addDocument(transaction.getId(), docUri,"id123","SampleDocument","", approvalsList, new CreateTransactionViewModel.AddDocumentListener() {
            @Override
            public void documentAddSuccessful(final String transactionId, String documentId) {
                Util.runOnMainThread(new Util.MainThreadListener() {
                    @Override
                    public void executeOnMainThread() {
                        CreateTransactionViewModel.sendTransaction(transactionId);
                        ESignLive.getInstance().startTransactionWithId(transactionId,false);
                    }
                });
            }

            @Override
            public void documentAddFailed(String transactionId, String documentId, Error error) {
                Log.e("APP",error.toString());
            }
        });


    } catch (Exception e) {
        e.printStackTrace();
    }
}
In addition, the iOS/Android SDKs will be placed on GitHub in the near future and have interact-able code snippets.
Haris Haidary OneSpan Technical Consultant

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off