当前位置: 首页>>代码示例>>Java>>正文


Java WifiP2pDevice.FAILED属性代码示例

本文整理汇总了Java中android.net.wifi.p2p.WifiP2pDevice.FAILED属性的典型用法代码示例。如果您正苦于以下问题:Java WifiP2pDevice.FAILED属性的具体用法?Java WifiP2pDevice.FAILED怎么用?Java WifiP2pDevice.FAILED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.net.wifi.p2p.WifiP2pDevice的用法示例。


在下文中一共展示了WifiP2pDevice.FAILED属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getP2pDeviceStatus

private static String getP2pDeviceStatus(int deviceStatus) {
    Log.d(TAG, "Peer status :" + deviceStatus);
    switch (deviceStatus) {
        case WifiP2pDevice.AVAILABLE:
            return "Available";
        case WifiP2pDevice.INVITED:
            return "Invited";
        case WifiP2pDevice.CONNECTED:
            return "Connected";
        case WifiP2pDevice.FAILED:
            return "Failed";
        case WifiP2pDevice.UNAVAILABLE:
            return "Unavailable";
        default:
            return "Unknown";
    }
}
 
开发者ID:jphacks,项目名称:TK_1701,代码行数:17,代码来源:WiFiDirect.java

示例2: getDeviceStatus

static String getDeviceStatus(int deviceStatus) {
    Log.d(FileTransferService.TAG, "Peer status :" + deviceStatus);
    switch (deviceStatus) {
        case WifiP2pDevice.AVAILABLE:
            return "Available";
        case WifiP2pDevice.INVITED:
            return "Invited";
        case WifiP2pDevice.CONNECTED:
            return "Connected";
        case WifiP2pDevice.FAILED:
            return "Failed";
        case WifiP2pDevice.UNAVAILABLE:
            return "Unavailable";
        default:
            return "Unknown";
    }
}
 
开发者ID:archos-sa,项目名称:aos-FileCoreLibrary,代码行数:17,代码来源:Utils.java

示例3: getDeviceStatus

private static String getDeviceStatus(int deviceStatus) {
    Log.d(WiFiDirectActivity.TAG, "Peer status :" + deviceStatus);
    switch (deviceStatus) {
        case WifiP2pDevice.AVAILABLE:
            return "Available";
        case WifiP2pDevice.INVITED:
            return "Invited";
        case WifiP2pDevice.CONNECTED:
            return "Connected";
        case WifiP2pDevice.FAILED:
            return "Failed";
        case WifiP2pDevice.UNAVAILABLE:
            return "Unavailable";
        default:
            return "Unknown";

    }
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:18,代码来源:DeviceListFragment.java

示例4: getDeviceStatus

public static String getDeviceStatus(int statusCode) {
    switch (statusCode) {
        case WifiP2pDevice.CONNECTED:
            return "Connected";
        case WifiP2pDevice.INVITED:
            return "Invited";
        case WifiP2pDevice.FAILED:
            return "Failed";
        case WifiP2pDevice.AVAILABLE:
            return "Available";
        case WifiP2pDevice.UNAVAILABLE:
            return "Unavailable";
        default:
            return "Unknown";

    }
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:17,代码来源:WiFiDirectServicesList.java

示例5: getDeviceStatus

private static String getDeviceStatus(int deviceStatus){
    Log.e(WiFiDirectActivity.TAG, "Peer status: "+deviceStatus);
    switch(deviceStatus){
    case WifiP2pDevice.AVAILABLE:
        return "Avaiable";
    case WifiP2pDevice.INVITED:
        return "Invited";
    case WifiP2pDevice.CONNECTED:
        return "Conntend";
    case WifiP2pDevice.FAILED:
        return "Failed";
    case WifiP2pDevice.UNAVAILABLE:
        return "Unavailable";
    default:
        return "Unkonw";
    }
}
 
开发者ID:coderminer,项目名称:Demo_Public,代码行数:17,代码来源:DeviceListFragment.java

示例6: deviceStatusToString

/**
 * Translates a device status code to a readable String status
 * @param status
 * @return A readable String device status
 */
public String deviceStatusToString(int status) {
    if (status == WifiP2pDevice.AVAILABLE) {
        return "Available";
    } else if (status == WifiP2pDevice.INVITED) {
        return "Invited";
    } else if (status == WifiP2pDevice.CONNECTED) {
        return "Connected";
    } else if (status == WifiP2pDevice.FAILED) {
        return "Failed";
    } else if (status == WifiP2pDevice.UNAVAILABLE) {
        return "Unavailable";
    } else {
        return "Unknown";
    }
}
 
开发者ID:Crash-Test-Buddies,项目名称:WiFi-Buddy,代码行数:20,代码来源:WifiDirectHandler.java

示例7: getDeviceStatus

private static String getDeviceStatus(int deviceStatus) {
    Log.d(WiFiDirectActivity.TAG, "Peer status :" + deviceStatus);
    switch (deviceStatus) {
        case WifiP2pDevice.AVAILABLE:
            return "Available"; //可以连接
        case WifiP2pDevice.INVITED:
            return "Invited"; //邀请连接
        case WifiP2pDevice.CONNECTED:
            return "Connected"; //已连接
        case WifiP2pDevice.FAILED:
            return "Failed";    //失败
        case WifiP2pDevice.UNAVAILABLE:
            return "Unavailable"; //不可以连接
        default:
            return "Unknown";

    }
}
 
开发者ID:lucky-code,项目名称:Practice,代码行数:18,代码来源:DeviceListFragment.java

示例8: onClick

@Override
public void onClick(View v) {
    int position = Integer.parseInt(v.getTag().toString());
    WifiP2pDevice device = mData.get(position);
    switch (device.status){
        case WifiP2pDevice.AVAILABLE:
        case WifiP2pDevice.CONNECTED:
        case WifiP2pDevice.INVITED:
            ((MainActivity)mContext).connect(device);
            break;
        case WifiP2pDevice.FAILED:
        case WifiP2pDevice.UNAVAILABLE:
            Toast.makeText(mContext,String.format(Locale.getDefault(),"status=%d",device.status),Toast.LENGTH_SHORT).show();
            break;
    }

}
 
开发者ID:niyueming,项目名称:WiFiP2PDemo,代码行数:17,代码来源:WifiP2pDeviceAdapter.java


注:本文中的android.net.wifi.p2p.WifiP2pDevice.FAILED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。