工具页面增加airkiss测试
This commit is contained in:
parent
ba54b1ff84
commit
bc5fafab52
|
|
@ -539,7 +539,7 @@ public class BindTankActivity extends BaseActivity {
|
|||
startActivity(i);
|
||||
AnimationUtil.startAnimation(BindTankActivity.this);
|
||||
break;
|
||||
case R.id.tv_thiswifi:
|
||||
case R.id.tv_thiswifi://跳转热点连接
|
||||
Intent intentwifi = new Intent(BindTankActivity.this, HotSpotConnentActivity.class);
|
||||
startActivity(intentwifi);
|
||||
AnimationUtil.startAnimation(BindTankActivity.this);
|
||||
|
|
|
|||
|
|
@ -13,9 +13,14 @@ import android.net.wifi.WifiManager;
|
|||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
|
||||
|
||||
public class PhoneInfoActivity extends AppCompatActivity {
|
||||
|
||||
private TextView textViewModel;
|
||||
|
|
@ -49,6 +54,22 @@ public class PhoneInfoActivity extends AppCompatActivity {
|
|||
// Permission has already been granted
|
||||
getPhoneInfo();
|
||||
}
|
||||
|
||||
findViewById(R.id.test_airkiss).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String appId = "wxb3b27d653ec3e3cb"; // 厂商填移动应用(App)的 AppId
|
||||
IWXAPI api = WXAPIFactory.createWXAPI(PhoneInfoActivity.this, appId);
|
||||
WXLaunchMiniProgram.Req req = new WXLaunchMiniProgram.Req();
|
||||
req.userName = "gh_471f5f7b25a9";// 注意这是微信硬件的username,不需要改动
|
||||
req.path = "pages/discover-new/discover-new?ticket=234234";
|
||||
//以绑定为例,路径示例:"pages/discover-new/discover-new?ticket=234234",内部字符串不需要引号
|
||||
|
||||
req.miniprogramType = WXLaunchMiniProgram.Req.MINIPROGRAM_TYPE_PREVIEW;//注意这里可选不同版本TEST(测试版)/PREVIEW(体验版)/RELEASE(线上版),正常测试时使用体验版,正式上线时需切换至线上正式版
|
||||
api.sendReq(req);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void getPhoneInfo() {
|
||||
|
|
@ -100,7 +121,7 @@ public class PhoneInfoActivity extends AppCompatActivity {
|
|||
// 判断WiFi频段(2.4G或5G)
|
||||
if (frequency >= 2400 && frequency <= 2500) {
|
||||
tvWifiInfo.append("WiFi Band: 2.4GHz\n");
|
||||
} else if (frequency >= 5000 && frequency <= 6000) {
|
||||
} else if (frequency >= 4800 && frequency <= 6000) {
|
||||
tvWifiInfo.append("WiFi Band: 5GHz\n");
|
||||
} else {
|
||||
tvWifiInfo.append("WiFi Band: Unknown\n");
|
||||
|
|
|
|||
|
|
@ -8,8 +8,11 @@ import android.util.Log;
|
|||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.ifish.basebean.WxLoginMessageEvent;
|
||||
import com.lidroid.xutils.util.LogUtils;
|
||||
import com.tencent.mm.opensdk.constants.ConstantsAPI;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseReq;
|
||||
import com.tencent.mm.opensdk.modelbase.BaseResp;
|
||||
import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram;
|
||||
import com.tencent.mm.opensdk.modelmsg.SendAuth;
|
||||
import com.tencent.mm.opensdk.modelmsg.SendMessageToWX;
|
||||
import com.tencent.mm.opensdk.openapi.IWXAPI;
|
||||
|
|
@ -60,5 +63,12 @@ public class WXEntryActivity extends Activity implements IWXAPIEventHandler {
|
|||
EventBus.getDefault().post(new WxLoginMessageEvent(false, "失败"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (baseResp.getType() == ConstantsAPI.COMMAND_LAUNCH_WX_MINIPROGRAM) {
|
||||
WXLaunchMiniProgram.Resp launchMiniProResp = (WXLaunchMiniProgram.Resp) baseResp;
|
||||
String extraData = launchMiniProResp.extMsg; //对应组件 &amp;lt;button open-type="launchApp"&amp;gt; 中的 app-parameter 属性
|
||||
LogUtils.d("LHD airkiss "+extraData);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@
|
|||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="设备信息"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:text="设备信息" />
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvModel"
|
||||
|
|
@ -24,17 +24,18 @@
|
|||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="网络信息"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:text="网络信息" />
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvNetworkInfo"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="网络情况:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvWifiInfo"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
@ -42,4 +43,12 @@
|
|||
android:text="WiFi信息:" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/test_airkiss"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="test_airkiss" />
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
Loading…
Reference in New Issue