android+wifi+bridge,Android接入说明
Android接入说明
Android商户APP端前期准备
1.获取到统一SDK aar包.并放入android项目libs文件夹内(拷贝或者覆盖包时,请clean工程和重新build)
2.项目gradle配置SDK aar包,配置如下:
APP Gradle增加如下配置:
//向上兼容android系统
compileSdkVersion 26
defaultConfig {
}
repositories {
flatDir {
dirs 'libs'
}
}
//支付SDK
dependencies {
compile 'com.android.support:appcompat-v7:26.0.0'
compile(name: 'open-sdk-release-1.0.2', ext: 'aar') //支付AAR名称
}
3.AndroidMainfest.xml注册如下Activity:
支付结果回调:在AndroidMainfest.xml中com.xxx.PayResultActivity为接收支付回调的Activity,添加如下配置:
android:host="open"
android:path="/payResult"
android:scheme="allinone" />
快速集成
第一步:在SDK调用之前初始化SDK,建议将此代码放在Application中进行初始化。
接入统一SDK的商户需要初始化参数:WalletParms
字段名
变量
必填
类型
示例值
描述
uhid
用户唯一标识
是
String
dhid
否
String
sessionId
会话ID
是
String
telNo
手机号码
是
String
用户手机号码
userToken
用户token
是
String
longi
经度
否
String
用户经度
lati
维度
否
String
用户维度
mapSP
地图
否
String
b 百度 t 腾讯 a 高德 g google l 老虎
wifiPubChannel
发布渠道
否
String
wifiVersion
版本号
否
String
appId
appid
是
String
lxDex
开发环境
是
String
unionid
unionId
否
String
商户透传过来
保留字段,不传的话默认为""
platformName
商户名称
是
String
WIFI或者LIANXIN或者OPENSDK
一般为商户接入的大写字母例如:(WIFI/LIANXIN)
environmentBranch
环境
是
String
0:生产环境 1:测试环境 2:验证环境
deviceId
设备ID号
是
String
通过手机API获取
openId
开放ID
否
String
商户透传过来
保留字段,不传的话默认为""
merchantId
商户号
是
String
商户初始化透传
初始化字段:
platformName、environmentBranch、appId
示例代码:
WalletParams params = new WalletParams();
params.platformName = "OPENSDK";//接入平台:枚举值:WIFI 或LIANXIN 或OPENSDK,第三方请填OPENSDK
params.environmentBranch = 2;//服务器环境,0生成环境 1验证环境 2测试环境
params.appId="merchant01";//必填
params.merchantId="mer01";//必填 商户号
//其余选填
params.openId = "wifiopenId";//openId 选填
params.unionid = "wifiunionId";//unionid 选填
//.....其他要求必填字段,详情请参照WalletParms参数
WalletApi.getInstance().init(this, params);
第二步:发起支付,参数获取请参考API列表
PreOrderRespone字段说明(商户预收单数据返回)
字段名
变量
必填
类型
示例值
描述
appId
appId
是
String
ext
扩展信息
否
String
扩展信息
isRedpacket
是否是发红包
是
String
"true" or "false"
"true"发红包"false"支付
mchId
商户id
是
String
mPackage
需要接收支付回调APP应用包名
是
String
nonceStr
随机字符串
是
String
payResult
快应用支付结果页URL
否
String
快引用回调url
prepayId
预收单id
是
String
scheme
支付回调结果页面scheme
是
String
sign
验签
是
String
封装方法参考"唤起收银台参数封装代码示例"
signType
签名方法
是
String
RSA
RSA
timestamp
时间戳
是
String
10位时间戳
10位时间戳
tradeType
交易类型
是
String
APP
唤起收银台参数封装代码示例
/**
* mRespone 商户预收单返回参数。定义为PreOrderRespone
* 注意:发起支付前请确保初始化了sdk,初始化请往上翻
*/
PayTool.getInstance().startPay(this, mRespone);
以下功能选接:
启动账单页面
WalletApi.getInstance().init(this, params);
Intent intent = new Intent(Constants.UNIFIED_BILL_ACTION);
intent.setPackage(this.getPackageName());//第三方应用包名,下同
startActivity(intent);
启动零钱页面
WalletApi.getInstance().init(this, params);
Intent intent = new Intent(Constants.UNIFIED_REMAIN_ACTION);
intent.setPackage(this.getPackageName());
startActivity(intent);
启动首页
WalletApi.getInstance().init(this, params);
Intent intent = new Intent(Constants.UNIFIED_HOME_ACTION);
intent.setPackage(this.getPackageName());
startActivity(intent);
清除登录信息
WalletApi.delThirdToken(this);
清除栈
WalletApi.finishAllActivity();
在支付结果Activity的oncreate()和onNewIntent()中获取支付结果
private void getPayResult(){
if (getIntent() != null && getIntent().getExtras() != null) {
String what = (String) getIntent().getExtras().get("what");
int retcode = getIntent().getExtras().get("retcode");
String remsg = (String) getIntent().getExtras().get("retmsg");
String data = (String) getIntent().getExtras().get("data");
if (StringUtils.isEmpty(what)) return;
Toast.makeText(this, "what:" + what +"retcode:" + retcode + "remsg:" + remsg +"data:" + data, Toast.LENGTH_LONG).show();
}
}
代码混淆
##### openSDK支付,混淆start,建议放置到APP的混淆文件中,以防出现位置的错误######
-keepclassmembers class com.wifipay.wallet.home.net.dto.SPJSBridge {
public *;
}
#不混淆org.apache.http.legacy.jar
-dontwarn android.net.compatibility.**
-dontwarn android.net.http.**
-dontwarn com.android.internal.http.multipart.**
-dontwarn org.apache.commons.**
-dontwarn org.apache.http.**
-keep class android.net.compatibility.**{*;}
-keep class android.net.http.**{*;}
-keep class com.android.internal.http.multipart.**{*;}
-keep class org.apache.commons.**{*;}
-keep class org.apache.http.**{*;}
#all 快捷方式
-keep public class com.wifipay.wallet.home.shortcut.ShortcutEntrance{*;}
-dontwarn com.wifipay.wallet.home.shortcut.ShortcutEntrance.**
#end alipay
#-keep class com.sdpopen.wallet.**{*;}
#-keep class com.sdpopen.wallet.analysis_tool.**{*;}
-keep class com.sdpopen.wallet.bank.manager.model.**{*;}
#-keep class com.sdpopen.wallet.bankmanager.**{*;}
#-keep class com.sdpopen.wallet.common.**{*;}
-keep class com.sdpopen.wallet.common.dns.WifiPayHttpDNSManager{*;}
-keep class com.sdpopen.wallet.common.walletsdk_common.eventbus.**{*;}
#-keep class com.sdpopen.wallet.common.walletsdk_common.eventbus.ThreadMode{*;}
#-keep class com.sdpopen.wallet.common.walletsdk_common.eventbus.Subscribe{*;}
-keep class com.sdpopen.wallet.common.walletsdk_common.common.**{*;}
-keep class com.sdpopen.wallet.common.walletsdk_common.utils.**{*;}
-keep class com.sdpopen.wallet.common.walletsdk_common.bean.**{*;}
-keep class com.sdpopen.wallet.common.walletsdk_common.callback.**{*;}
-keep class com.sdpopen.wallet.common.walletsdk_common.login.**{*;}
-keep class com.sdpopen.wallet.common.walletsdk_common.**
-keep class com.sdpopen.wallet.compliance.**{*;}
#-keep class com.sdpopen.wallet.component_charge_transfer_withdraw.**{*;}
-keep class com.sdpopen.wallet.pay.wallet.**{*;}
#-keep class com.sdpopen.wallet.wallet_home.**{*;}
#-keep class com.sdpopen.wallet.walletsdk_component.bill.**{*;}
-keep class com.shengpay.crypto.**{*;}
-keep class com.shengpay.json.**{*;}
-keep class com.shengpay.json.internal.**{*;}
-keep class com.shengpay.json.reflect.**{*;}
-keep class com.shengpay.json.stream.**{*;}
-keep class com.wifipay.common.security.**{*;}
-keep class com.shengpay.tool.**{*;}
-keep class com.sdpopen.wallet.BuildConfig{*;}
android+wifi+bridge,Android接入说明相关推荐
- android wifi 图标,android wifi信号强度与图标对应关系
android中wifi分为5个等级,对应的图标是0格,1格,2格,3格,4格. 那么对应的信号强度是多少呢? 根据wifimanager中的算法calculateSignalLevel可以算得: 0 ...
- android wifi布局,Android使用 WiFi 建立 P2P 连接
Wi-Fi 点对点(P2P)API 允许应用程序在无需连接到网络和热点的情况下连接到附近的设备.(Android Wi-Fi P2P 使用 Wi-Fi Direct™ 验证程序进行编译).Wi-Fi ...
- android wifi channel,Android实践 -- Android Wi-Fi 直连
Android Wi-Fi 直连 Wi-Fi直连是Android 4.0(API level 14)或更高的版本的才加入的新功能,使用Wi-Fi直连相关的 API可以发现并连接支持Wi-Fi直连的设备 ...
- qt android wifi,QtScrcpy: Android实时投屏软件,此应用程序提供USB(或通过TCP/IP)连接的Android设备的显示和控制。它不需要任何root访问权限...
QtScrcpy QtScrcpy可以通过USB(或通过TCP/IP)连接Android设备,并进行显示和控制.不需要root权限. 单个应用程序最多支持16个安卓设备同时连接. 同时支持GNU/Li ...
- android wifi tcpip,Android无线调试:tcpip无线连接 | WiFi apk无线连接
tcpip无线连接 | WiFi apk无线连接 Android开发中,一般都是使用USB有线来调试app,但是在无数据线或者插口松动的情况下,就无法实现.所以使用无线调试也是一种有效方式.先说两 ...
- android wifi增强,Android增强WiFi性能
条件:WiFi 5G自动切换,当小于-69db和备选WiFi大于-60db是切换 frameworks/opt/net/wifi/service/java/com/android/server/wif ...
- android wifi 5g,android 判断 wifi 是否是 5G
/** * 判断 wifi 是否是 5G MHZ. * 需要权限: * * * * */ public static boolean isWifi5G(Context context) { int f ...
- android wifi 视频,Android开发——通过wifi接收IPCamera视频流
前面,我们已经了解了怎么在android app上打开关闭和扫描,搜索wifi,现在,我来写一下怎么通过连接wifi来使app获取到IPCamera摄像头的视频. 一.通过URL获取视频的地址 二.创 ...
- android wi-fi框架,Android Wi-Fi 网络选择
本页将介绍 Android 11 中用于选择和切换 Wi-Fi 网络的算法和流程.Android 会不断评估已连接的网络以及其他可用网络的质量. 注意:本页上提供的详细信息并不全面,并且在将来的 An ...
最新文章
- 震后首游都江堰感怀(二)
- 三种SQL分页查询的存储过程
- 【学习笔记】mybatis中的缓存介绍和使用
- FastJSON 简介及其Map/JSON/String 互转(转载)
- 附加数据库时出错。有关详细信息,请单击“消息”列中的超链接。
- EPS 转 pdf 在线
- SqlServer中将某列的值拼接成字符串
- 广西大学计算机硕导名单,导师-广西大学研究生院
- vim - 自动补齐
- maxdea如何计算指数_MaxDEA
- 静止轨道卫星几何校正——FY-4A几何校正(风云系列静止卫星可以参考)
- 软件开发流程——V模型
- [转载]论原著中白飞飞和朱七七两大奇女子
- H5聊天对话气泡的一种实现方式及原理
- 必学技术java Swing之随心所欲添加自定义位置和大小的组件(建议收藏)
- excel两个表格数据对比_用Excel一键抓取网页表格数据
- kingbase之ksql命令工具
- vue3中使用tsx
- CMD命令下获取昨日日期
- 地籍管理 : 宗地数据处理的一般步骤
热门文章
- html5圆圈,HTML5动感圆圈
- Pandas - 操作DataFrame
- 得大数据者 得新工业革命先机
- 为什么qq没有位置服务器,腾讯QQ内测扩列功能上线 2019QQ扩列为什么找不到
- 七星耀华GNSS平仓振捣自动形变监测系统助力水电站实现智能工程
- 【日本IT】连自社開発、受託企業、SES都不知道,你就敢赴日干IT?
- 想在2020年竞争“出位”,品牌营销该怎么做?想在2020年竞争“出位”,品牌营销该怎么做?
- 【Cisco Packet Tracer(思科)交换机和路由器配置实例】
- 第一次用uni-app写项目,无法自动运行微信小程序,怎么解决呢
- 偶数表达方式 matlab,如果用a表示非零自然数,那么偶数可以表示为( )。 ①a+2 ② 2a ③a-1 ④2a-1——青夏教育精英家教网——...