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.

5 thoughts on “Android Signature Capture Example Using Signature Pad Library

  1. Kiala

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

    Thanks

    Reply
  2. Dr.K.T.S.S.Rajajee

    Nice its working but where to search for saved signatures

    Reply

Leave a Reply

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