Wifi直接群组拥有者地址 [英] Wifi Direct Group Owner Address

查看:95
本文介绍了Wifi直接群组拥有者地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个简单的问题,我必须使用"Wifi Direct"获取"Group Owner address",我知道这在WifiP2pInfo.GroupOwnerAddress中,但是如何初始化WifiP2pInfo.groupOnwerAddress以在其中获取Group Owner地址.我的申请?

That's an easy question, I've to get the "Group Owner address" using "Wifi direct", I know that this is in WifiP2pInfo.GroupOwnerAddress, but how can I initialize WifiP2pInfo.groupOnwerAddress to get the Group Owner address in my application?

有人可以给我通行证吗?我是android和java的新手.

Could someone give me a pass to pass? I'm new in android and java.

非常感谢.

推荐答案

NetworkInfo networkInfo = (NetworkInfo)intent.getParcelableExtra(extraKey);

  if (networkInfo.isConnected()) {
    wifiP2pManager.requestConnectionInfo(wifiDirectChannel, 
      new ConnectionInfoListener() {
        public void onConnectionInfoAvailable(WifiP2pInfo info) { 


            Toast toast=Toast.makeText(class.this,info.groupOwnerAddress.getHostAddress().toString, Toast.LENGHT_SHORT); 
            toast.show();    

        }
      }
  }

对不起,您迟到了.这是所有者IP info.groupOwnerAddress.getHostAddress().toString

Sorry for late answer. This is owner IP info.groupOwnerAddress.getHostAddress().toString

这篇关于Wifi直接群组拥有者地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆