I am new to Android. I am developing an application that requires a user signature. How can I capture a signature in Android?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Your question is a little too broad. Try asking a question about a specific problem, not "how do I do something general". See the FAQ for more information about how to ask a question.
Here is a vague idea though:
You'll want to have a canvas object that can allow the user to draw to the screen. Here is a link on SO about it. Android drawing a line to follow your finger
Then you'll want to output that bitmap as a file: Save bitmap to location
Here's how I have capture human signature and save image using this example:
https://demonuts.com/android-capture-digital-signature/
First add following to your gradle:
activity_main.xml:
MainActivity.java:
Don't forget to give READ-WRITE permission in manifest.xml
Many applications ask their users to accept an agreement, but I can't think of one I've used that's asked me for my actual signature.
Is there a good reason that your users aren't able to accept yr agreement in the usual way? (via a check box or by hitting a button marked 'I accept'?)
There are also privacy concerns relating to obtaining a graphical representation of a user's signature. Once obtained, I have no idea what your company will do with my signature. A signature is a valuable piece of personal information, which could ultimately be used for identity theft.
You can do this in two ways:
1. Your own Implementation
You can use canvas to draw signatures. Use paint object to set signature stroke size & color.
2. Simply use library
See SignatureView library. It will do all, what you want.
https://github.com/zahid-ali-shah/SignatureView