nasnano下载地址:https://nano.nebulas.io/index_cn.html
在你的项目工程中引入该项目,下面的方式仅为示例(其他包依赖管理方式均可):
Build libnebulas目录下,libnebulas-release.aar
(1)将aar包复制到你项目的libs中
(2)在build.gradle中引入相关依赖描述
repositories {
flatDir {
dir 'libs'
}
}
dependencies {
...
+ compile(name: 'libnebulas-release', ext: 'aar')
+ implementation 'com.squareup.okhttp3:okhttp:3.10.0'
+ implementation 'com.google.code.gson:gson:2.8.4'
...
}
public static void pay(Context context,int mainNet, GoodsModel goods, String to, String value, String serialNumber)
clickButton.setOnClickListener( new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
GoodsModel gm = new GoodsModel();
gm.name = "mytestGood"; // 商品名称
gm.desc = "mytestGoodDesp"; //商品描述
String toAddr = "n1lxxx…………………………"; // 目标地址
String valueInWei = "your value"; // your value
String serialNumber = Util.getRandomCode(32);
SmartContracts.pay(MainActivity.this ,Constants.MAIN_NET, gm, toAddr, valueInWei, serialNumber);
}
});
public static void call(Context context, int mainNet, GoodsModel goods, String to, String value, String[] args, String serialNumber)
queryTransferStatus(int mainNet, String serialNumber, final SmartContracts.TransferStatusCallback callback)