मैं यहां उपलब्ध सैंपल एप्लिकेशन के साथ आस-पास कनेक्शन एपीआई का परीक्षण कर रहा हूं: https://github.com/googlesamples/android-nearby ऐसा लगता है कि यह कुछ उपकरणों के लिए काम नहीं कर रहा है। मैंने नेक्सस 7 के साथ सैमसंग गैलेक्सी एस 3 को सफलतापूर्वक कनेक्ट किया, दोनों दिशाओं में (मेजबान के रूप में एस 3, एन 7 गुलाम और इसके विपरीत)। हालांकि, जब मैं सैमसंग गैलेक्सी एस 3 को नेक्सस 5 से कनेक्ट करने का प्रयास करता हूं, तो कनेक्शन हमेशा कोड कोड 8005 के साथ विफल रहता है।एंड्रॉइड के लिए आस-पास कनेक्शन एपीआई - कुछ डिवाइसों के लिए काम नहीं कर रहा है
नीचे आप मेजबान से कनेक्ट करने के लिए दास (डिवाइस की खोज) द्वारा लागू विधि को देख सकते हैं (विज्ञापन डिवाइस)।
private void connectTo(String endpointId, final String endpointName) {
debugLog("connectTo:" + endpointId + ":" + endpointName);
// Send a connection request to a remote endpoint. By passing 'null' for the name,
// the Nearby Connections API will construct a default name based on device model
// such as 'LGE Nexus 5'.
String myName = null;
byte[] myPayload = null;
Nearby.Connections.sendConnectionRequest(mGoogleApiClient, myName, endpointId, myPayload,
new Connections.ConnectionResponseCallback() {
@Override
public void onConnectionResponse(String endpointId, Status status,
byte[] bytes) {
Log.d(TAG, "onConnectionResponse:" + endpointId + ":" + status);
if (status.isSuccess()) {
debugLog("onConnectionResponse: " + endpointName + " SUCCESS");
Toast.makeText(MainActivity.this, "Connected to " + endpointName,
Toast.LENGTH_SHORT).show();
mOtherEndpointId = endpointId;
updateViewVisibility(STATE_CONNECTED);
} else {
debugLog("onConnectionResponse: " + endpointName + " FAILURE. ResponseCode=" + status.getStatusCode() + " statusMessage=" + status.getStatusMessage());
}
}
}, this);
}
परिणाम मैं हमेशा मिलता है:
11-17 18: 48: 50.678 11,133-11,133/com.google.example.connectionsquickstart डी/MainActivity: onConnectionResponse: सैमसंग GT-I9300 विफलता। ResponseCode = 8005 स्थिति मैसेज = शून्य
कोई संकेत क्या चल रहा है?
करता है नेक्सस 7 के साथ गठजोड़ 5 काम करता है? https://productforums.google.com/forum/#!topic/nexus/o-UyGECxh2k –