在PhoneGap的Andr​​oid应用程序签名捕获应用程序、PhoneGap、Andr、oid

2023-09-06 14:12:27 作者:流年在指尖肆意奔腾

我试图用这个第三方签名捕获Android应用程序与我的PhoneGap应用。我不知道如何从我的PhoneGap的应用程序调用正确的活动。我的应用程序是用HTML和JavaScript。

请帮帮忙!

我已经安装在我的Droid X的应用程序,它捕获我的签名与我的手指。它的超平滑快捷。

http://www.binarysolutions.biz/

下面是从他们的网站的说明。他们不是很详细。

 字符串键=; //设置键,任何字符串你找到合适的字符串文件名=; //设置文件名(全局写权限)意向意图=新意图(biz.binarysolutions.signature.CAPTURE);intent.putExtra(键,文件名);intent.setComponent(    新组件名(        biz.binarysolutions.signature        biz.binarysolutions.signature.Capture    ));startActivityForResult(意向,CAPTURE_REQUEST_ code);接收结果@覆盖保护无效的onActivityResult    (         INT申请code,         INT结果code,         数据意向    ){    super.onActivityResult(要求code,结果code,数据);    如果(要求code == CAPTURE_REQUEST_ code和;&安培;        结果code == RESULT_OK){        字符串文件名=; //相同的文件名以上        位图位图= BitmapFactory.de codeFILE(文件名);        //做任何你喜欢的位图    }} 

解决方案

签名应用程序的集成是通过 Android的意图可行的调用签名的应用程序。看起来你有你需要在做什么的指示的的Java 的(本机)方与签名应用程序集成,但你是亏本内这样做的 PhoneGap的 Android应用程序。

看看WebIntent.这是一个的PhoneGap Android的插件 - 这是一个扩展到的PhoneGap API,它由一个小的的JavaScript 的界面,你的的PhoneGap 应用程序使用,并且本机(的Java 的)组件的 JS 接口会谈。在 WebIntent 博客文章上面链接实际上做解释的pretty做好一个的PhoneGap 插件,太

什么你就必须与整合的 WebIntent 插件的接口是在 WebIntent 上方做签名的应用程序 - 这样意图获取有关本机端包含正确的参数传递周围

I am trying to use this 3rd Party Signature Capture Android Application with my PhoneGap Application. I have no idea how to "Call the right Activity" from my PhoneGap App. My Application is written in html and javascript.

Please help!

I have installed the application on my Droid X and it Captures my Signature with my finger. Its super smooth and quick.

http://www.binarysolutions.biz/

Here are the instructions from their website. They are not very detailed.

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
    }
}

解决方案

The integration of the signature application is doable via an Android Intent to invoke the signature app. Looks like you have the instructions for what you need to do on the Java (native) side to integrate with the signature application, but you are at a loss to do so inside a PhoneGap Android app.

Take a look at WebIntent. It is a PhoneGap Android plug-in - this is an extension to the PhoneGap API and is composed of a small JavaScript interface which your PhoneGap app uses, and a native (Java) component that the JS interface talks to. The WebIntent blog post linked above actually does a pretty good job of explaining a PhoneGap plug-in, too.

What you'll have to do on top of integrating the WebIntent plug-in is interfacing the WebIntent with the Signature app - so the intents getting passed around on the native side contain the proper parameters.