我不能得到你的問題很好,但我認爲這是解決這個樣子。 您可以使用mCallId的編碼和解碼來完成此操作。 而placeing通話編碼CALLID
public String Encode(String str) {
byte[] data = null;
try {
data = str.getBytes("UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String base64 = Base64.encodeToString(data, Base64.DEFAULT);
return base64;
}
和使用呼叫ID爲
Call call = getSinchServiceInterface().callUser(Encode(name));
和接收呼叫
public String decode(String str) {
byte[] data = Base64.decode(str, Base64.DEFAULT);
String text = null;
try {
text = new String(data, "UTF-8");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return text;
}
,並用它
String userEncoded = call.getRemoteUserId();
String decodedUserName = decode(userEncoded);
來源
2015-10-07 05:03:21
DDN