added in API level 9

SipProfile.Builder

public static class SipProfile.Builder
extends Object

java.lang.Object
   ↳ android.net.sip.SipProfile.Builder


Helper class for creating a SipProfile.

Summary

Public constructors

SipProfile.Builder(SipProfile profile)

Creates a builder based on the given profile.

SipProfile.Builder(String uriString)

Constructor.

SipProfile.Builder(String username, String serverDomain)

Constructor.

Public methods

SipProfile build()

Builds and returns the SIP profile object.

SipProfile.Builder setAuthUserName(String name)

Sets the username used for authentication.

SipProfile.Builder setAutoRegistration(boolean flag)

Sets the auto.

SipProfile.Builder setDisplayName(String displayName)

Sets the display name of the user.

SipProfile.Builder setOutboundProxy(String outboundProxy)

Sets the outbound proxy of the SIP server.

SipProfile.Builder setPassword(String password)

Sets the password of the SIP account

SipProfile.Builder setPort(int port)

Sets the port number of the server.

SipProfile.Builder setProfileName(String name)

Sets the name of the profile.

SipProfile.Builder setProtocol(String protocol)

Sets the protocol used to connect to the SIP server.

SipProfile.Builder setSendKeepAlive(boolean flag)

Sets the send keep-alive flag.

Inherited methods

Public constructors

SipProfile.Builder

added in API level 9
public SipProfile.Builder (SipProfile profile)

Creates a builder based on the given profile.

Parameters
profile SipProfile

SipProfile.Builder

added in API level 9
public SipProfile.Builder (String uriString)

Constructor.

Parameters
uriString String: the URI string as "sip:@"

Throws
ParseException if the string is not a valid URI

SipProfile.Builder

added in API level 9
public SipProfile.Builder (String username, 
                String serverDomain)

Constructor.

Parameters
username String: username of the SIP account

serverDomain String: the SIP server domain; if the network address is different from the domain, use setOutboundProxy(String) to set server address

Throws
ParseException if the parameters are not valid

Public methods

build

added in API level 9
public SipProfile build ()

Builds and returns the SIP profile object.

Returns
SipProfile the profile object created

setAuthUserName

added in API level 12
public SipProfile.Builder setAuthUserName (String name)

Sets the username used for authentication.

Parameters
name String: authentication username of the profile

Returns
SipProfile.Builder this builder object

setAutoRegistration

added in API level 9
public SipProfile.Builder setAutoRegistration (boolean flag)

Sets the auto. registration flag.

Parameters
flag boolean: true if the profile will be registered automatically, false otherwise

Returns
SipProfile.Builder this builder object

setDisplayName

added in API level 9
public SipProfile.Builder setDisplayName (String displayName)

Sets the display name of the user.

Parameters
displayName String: display name of the user

Returns
SipProfile.Builder this builder object

setOutboundProxy

added in API level 9
public SipProfile.Builder setOutboundProxy (String outboundProxy)

Sets the outbound proxy of the SIP server.

Parameters
outboundProxy String: the network address of the outbound proxy

Returns
SipProfile.Builder this builder object

setPassword

added in API level 9
public SipProfile.Builder setPassword (String password)

Sets the password of the SIP account

Parameters
password String: password of the SIP account

Returns
SipProfile.Builder this builder object

setPort

added in API level 9
public SipProfile.Builder setPort (int port)

Sets the port number of the server. By default, it is 5060.

Parameters
port int: port number of the server

Returns
SipProfile.Builder this builder object

Throws
IllegalArgumentException if the port number is out of range

setProfileName

added in API level 9
public SipProfile.Builder setProfileName (String name)

Sets the name of the profile. This name is given by user.

Parameters
name String: name of the profile

Returns
SipProfile.Builder this builder object

setProtocol

added in API level 9
public SipProfile.Builder setProtocol (String protocol)

Sets the protocol used to connect to the SIP server. Currently, only "UDP" and "TCP" are supported.

Parameters
protocol String: the protocol string

Returns
SipProfile.Builder this builder object

Throws
IllegalArgumentException if the protocol is not recognized

setSendKeepAlive

added in API level 9
public SipProfile.Builder setSendKeepAlive (boolean flag)

Sets the send keep-alive flag.

Parameters
flag boolean: true if sending keep-alive message is required, false otherwise

Returns
SipProfile.Builder this builder object