當前位置: 首頁>>代碼示例>>Java>>正文


Java WifiP2pDevice.UNAVAILABLE屬性代碼示例

本文整理匯總了Java中android.net.wifi.p2p.WifiP2pDevice.UNAVAILABLE屬性的典型用法代碼示例。如果您正苦於以下問題:Java WifiP2pDevice.UNAVAILABLE屬性的具體用法?Java WifiP2pDevice.UNAVAILABLE怎麽用?Java WifiP2pDevice.UNAVAILABLE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.net.wifi.p2p.WifiP2pDevice的用法示例。


在下文中一共展示了WifiP2pDevice.UNAVAILABLE屬性的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.UNAVAILABLE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。