Android 对接腾讯人工智能AI 通用OCR接口
2018-01-15 本文已影响504人
李奥瑞克王
第一步:
获取官网注册时生成的Appid和AppKey
第二步:
大多数人基本卡在了获取自我签名这一步。
1.先按照官网要求组装数据,以下是组装数据需要的步骤及工具方法
![](https://img.haomeiwen.com/i4325487/8352e264d6264a28.png)
![](https://img.haomeiwen.com/i4325487/067b55e30e77e090.png)
![](https://img.haomeiwen.com/i4325487/dbac7f87f4a8d105.png)
![](https://img.haomeiwen.com/i4325487/fc367b9bb46de9fb.png)
2.按照官网坑爹的签名算法对组装数据进行签名。
![](https://img.haomeiwen.com/i4325487/64ec5409661ca82b.png)
![](https://img.haomeiwen.com/i4325487/4baefc97d5622aec.png)
![](https://img.haomeiwen.com/i4325487/b0d439222fc70022.png)
![](https://img.haomeiwen.com/i4325487/2e2a764185f4b6ad.png)
ServerPath 为接口请求地址。
content为接口请求参数的拼接。拼接方式为key1=value&key2=value2&key3=value3
鸣谢:
![](https://img.haomeiwen.com/i4325487/45d006ab486aeeef.png)
![](https://img.haomeiwen.com/i4325487/7bdd3ddac7ddd00f.png)
参考链接:https://gitee.com/xshuai/ai/tree/master/AIDemo/src/main/java/com/xs/tencent/aai
吐槽一下:gitee真心不好用。尤其是注册~!