Android Signature Capture Example Using Signature Pad Library

Here you will get android signature capture example.

You may have seen many eCommerce companies like Amazon provides a facility for digital signature. You can implement that feature in your app easily by using a library called Signature Pad.

Video Demo

Below tutorial shows you how to do this.

Android Signature Capture Example

Add to Layout

You can simply add a signature drawing view to your xml layout by using following tag.

Apply Listener

You can simply apply a listener to Signature Pad widget in following way.

Get Data

You can get signature data by following methods.

  • getSignatureBitmap() – Gets signature bitmap with a white background.
  • getTransparentSignatureBitmap() – Gets signature bitmap with a transparent background.
  • getSignatureSvg() – Gets signature Scalable Vector Graphics document.

For clearing the signature pad area use clear() method.

In below example I have just captured the signature and not saved it anywhere. You can get signature data using above methods and then save anywhere like in database or server.

Android Project

First create an android project with package name com.signaturecapture or you can use your existing project.

Now we have to add the Signature Pad library to our project. Add following line in your app level build.gradle file under dependencies section and then sync the project.

Add following code in respective files.

activity_main.xml

MainActivity.java

Save and run your project.

Screenshot

Android Signature Capture Example Using Signature Pad Library

Comment below if you have any queries related to above android signature capture example.

15 thoughts on “Android Signature Capture Example Using Signature Pad Library”

  1. Hi, Thank you!It works perfectily!
    So, where can I get the complete documentation for that SignaturePad library?

    Thanks

      1. But if we Share Bitmap share through Intent (bitmap size is greater than 1 mb then crash) then we have to convert bitmap to FileUri and save on Cache to URi and get the Uri from Cache in Another Activity

    1. Just intent your bitmap to other activity and set in imageview like below
      imageview.setImageBitmap(signaturePad.getSignatureBitmap());

  2. Pravinsingh Waghela

    Signiture works fine, but Its Not smooth, One cant put a dot in the signature! Any way to do so, or Am I only facing the issue?

  3. Ntonsite Mwamlima

    Hi Buddy,

    great content buddy and very helpful, may you please share with me on saving the signature to a Gallery or to the Database. I have accomplished what you just did successfully i am stacked on how to send image on both gallery and server.

    Thanks in advance

Leave a Comment

Your email address will not be published. Required fields are marked *