This is an App Inventor extension. 这是一个为App Inventor创建的拓展组件
Some work for getting access with Baidu AI api and Tencent Youtu
鉴于App Inventor的部分功能缺失,这里使用拓展来完成了百度AI开放平台和腾讯优图的鉴权工作(签名生成)
Event / 事件
- GotAuth(String auth)
- Called when got auth key from baidu server.
- 百度服务器返回授权签名之后调用此事件
Functions / 函数(方法)
- GetAuth(String apiKey, String securetKey)
- Call this to apply auth key and wait for it until receive the response.
- 同步请求授权签名,会堵塞界面
- GetAuthAsync(String apiKey, String securetKey)
- Call this to apply auth key, event GotAuth will be called when receive the response.
- 异步请求授权签名,获得签名后会调用GotAuth事件
Functions / 函数(方法)
- Base64(String data)
- ByteLength(String text)
- Get byte length using default encoding of the system
- 获取字符串在系统默认编码下的字节长度
- ByteLengthWithEncoding(String text, String encoding)
- Get byte length with specific encoding, e.g.
utf-8
- 获取字符串在用户指定编码下的字节长度,如
utf-8
- Get byte length with specific encoding, e.g.
- FormatString(String format, List arguments)
- en - https://dzone.com/articles/java-string-format-examples
- zh - https://blog.csdn.net/lonely_fireworks/article/details/7962171
- example: This will return "Hi, Tom and Jerry"
- GetAuth(String appId, String secret_id, String secret_key)
- Call this to calculate auth key.
- 计算授权签名,本地操作,不会堵塞界面
- MD5(String data)