本文整理汇总了Java中android.net.sip.SipProfile类的典型用法代码示例。如果您正苦于以下问题:Java SipProfile类的具体用法?Java SipProfile怎么用?Java SipProfile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SipProfile类属于android.net.sip包,在下文中一共展示了SipProfile类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initSip
import android.net.sip.SipProfile; //导入依赖的package包/类
private void initSip() {
account = SipApplication.getInstance().getAccount();
sipManager = SipManager.newInstance(this);
if (sipManager == null) {
showToast("SIP feature is not supported in your device");
return;
}
try {
SipProfile.Builder builder = new SipProfile.Builder(account.getUsername(), account.getDomain());
builder.setPassword(account.getPassword());
sipProfile = builder.build();
connectSip();
} catch (ParseException e) {
e.printStackTrace();
Log.e(TAG, e.getMessage());
showToast(e.getMessage());
}
}
示例2: createSipProfile
import android.net.sip.SipProfile; //导入依赖的package包/类
/**
* Create a {@link SipProfile} to use as backend.
*
* @param username The username at the service.
* @param password The password for authentication.
* @param domain The domain for the service.
* @param proxyAddress A proxy to connect to.
* @return The build {@link SipProfile}.
* @throws ParseException If the Sip Uri can not be parsed.
*/
public static SipProfile createSipProfile(String username, String password, String domain, String proxyAddress) throws ParseException {
SipProfile.Builder builder = new SipProfile.Builder(username, domain);
builder.setPassword(password)
.setOutboundProxy(proxyAddress);
return builder.build();
}