上面是android系统下和SIP相关的类和接口。SipDemo总共有三个文件组成,两个activity和一个广播监听者。通过工程文件夹中的AndroidManifest.xml文件可以发现,SipDemo的启动activity是WalkieTalkieActivity类。
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.walkietalkie);
ToggleButton pushToTalkButton = (ToggleButton) findViewById(R.id.pushToTalk);
pushToTalkButton.setOnTouchListener(this);
// Set up the intent filter. This will be used to fire an
// IncomingCallReceiver when someone calls the SIP address used by this
// application.
IntentFilter filter = new IntentFilter();
filter.addAction("android.SipDemo.INCOMING_CALL");
callReceive