Hi,
I have been playing around with the sipdemo and I have created simple
application. The
application creates SIPManager object and attempts to connect using
SipProfile to sip2sip.info.
This doesn't work either from the phone (Samsung Galaxy 2 running 2.3
Android) or the emulator.
I get back sip manager not supported, voip not supported in toast message.
Does anyone know how the library would be disabled on phones by an
operator, or what I think the phone vendor?
The support of SIP is important for next genration handsets. ( google IMS)
Without such stuff like LTE and IMS style applications will be limited to
appliacations running on PCs such as a broadband access cllient.
Cheers,
Graham
package gb.org;
import java.text.ParseException;
import android.app.Activity;
import android.net.sip.*;
import android.os.Bundle;
import android.util.Log;
import android.widget.EditText;
import android.widget.Toast;
public class gbsip extends Activity {
public SipManager manager = null;
public SipProfile me = null;
//temporary sip settings
public String name = "gbwien";
public String domain = "sip2sip.info";
public String password = "h7eefbtcff";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
//this.apiSupport = (EditText) findViewById(R.id.api);
//this.voipSupported = (EditText) findViewById(R.id.voip);
initializeManager();
}
//CREATE A NEW SIP MANAGER INSTANCE
public void initializeManager() {
if(manager == null) {
manager = SipManager.newInstance(this);
Toast.makeText(gbsip.this, "Manager supported " +
manager.isApiSupported(this), Toast.LENGTH_LONG).show();
Toast.makeText(gbsip.this, "VOIP supported " +
manager.isVoipSupported(this), Toast.LENGTH_LONG).show();
}
initializeLocalProfile();
}
//LOG INTO SIP ACCOUNT USING A SIP PROFILE LOCAL TO THE
//DEVICE
public void initializeLocalProfile() {
if (manager == null) {
Toast.makeText(gbsip.this, "manager is null ",
Toast.LENGTH_LONG).show();
return;
}
if (me != null) {
closeLocalProfile();
}
try {
SipProfile.Builder builder = new
SipProfile.Builder(name, domain);
builder.setPassword(password);
me = builder.build();
Toast.makeText(gbsip.this, "SIP Registration
successful .... ",
Toast.LENGTH_LONG).show();
// Otherwise the methods aren't guaranteed
to fire.
manager.setRegistrationListener(me.getUriString(), new
SipRegistrationListener() {
public void onRegistering(String localProfileUri)
{
Toast.makeText(gbsip.this, "Registrating with
SIP Server.... ", Toast.LENGTH_LONG).show();
}
public void onRegistrationDone(String
localProfileUri, long expiryTime) {
Toast.makeText(gbsip.this, "Ready ",
Toast.LENGTH_LONG).show();
}
public void onRegistrationFailed(String
localProfileUri, int errorCode,
String errorMessage) {
Toast.makeText(gbsip.this, "SIP Registration
error .... ", Toast.LENGTH_LONG).show();
}
});
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Toast.makeText(gbsip.this, "SIP Registration
error .... ",
Toast.LENGTH_LONG).show();
} catch (SipException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Toast.makeText(gbsip.this, "SIP Exception
has occurred .... ",
Toast.LENGTH_LONG).show();
}
}
//END OF initializeLocalProfile
public void closeLocalProfile() {
if (manager == null) {
return;
}
try {
if (me != null) {
manager.close(me.getUriString());
}
} catch (Exception ee) {
Log.d("failed ", "Failed to close local profile.",
ee);
}
}
}
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="gb.org"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/
app_name">
<activity android:name=".gbsip"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="10"/>
<uses-permission android:name="android.permission.USE_SIP"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-feature android:name="android.hardware.sip.voip"
android:required="true"/>
<uses-feature android:name="android.hardware.wifi"
android:required="true"/>
<uses-feature android:name="android.hardware.microphone"
android:required="true"/>
</manifest>
On Wed, Dec 21, 2011 at 10:56 PM, Shaun <[email protected]> wrote:
> From what I understand ICS is supposed to bring devices up to more or
> less equal standards, does this include the native SIP library, i.e.
> as soon as my Galaxy S II gets ICS will I be able to use the native
> SIP client on it and any other ICS device? Thanks!
>
> Shaun
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en