【发布时间】:2011-01-11 14:35:12
【问题描述】:
我正在尝试将此第 3 方签名捕获 Android 应用程序与我的 PhoneGap 应用程序一起使用。我不知道如何从我的 PhoneGap 应用程序中“调用正确的活动”。我的应用程序是用 html 和 javascript 编写的。
请帮忙!
我已经在我的 Droid X 上安装了该应用程序,它可以用我的手指捕获我的签名。它超级流畅和快速。
http://www.binarysolutions.biz/
这是他们网站上的说明。它们不是很详细。
String key = ""; // set the key, any string you find suitable
String fileName = ""; // set the file name (global write permissions)
Intent intent = new Intent("biz.binarysolutions.signature.CAPTURE");
intent.putExtra(key, fileName);
intent.setComponent(
new ComponentName(
"biz.binarysolutions.signature",
"biz.binarysolutions.signature.Capture"
)
);
startActivityForResult(intent, CAPTURE_REQUEST_CODE);
Receiving the result
@Override
protected void onActivityResult
(
int requestCode,
int resultCode,
Intent data
) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == CAPTURE_REQUEST_CODE &&
resultCode == RESULT_OK) {
String fileName = ""; // the same file name as above
Bitmap bitmap = BitmapFactory.decodeFile(fileName);
// do with bitmap whatever you like
}
}
【问题讨论】: