Index: pjproject/trunk/pjsip-apps/src/pjsua/android/.classpath
===================================================================
--- pjproject/trunk/pjsip-apps/src/pjsua/android/.classpath	(revision 4996)
+++ pjproject/trunk/pjsip-apps/src/pjsua/android/.classpath	(revision 4997)
@@ -2,7 +2,8 @@
 <classpath>
 	<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
-	<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="src" path="gen"/>
+	<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
 	<classpathentry kind="output" path="bin/classes"/>
 </classpath>
Index: pjproject/trunk/pjsip-apps/src/swig/java/android/AndroidManifest.xml
===================================================================
--- pjproject/trunk/pjsip-apps/src/swig/java/android/AndroidManifest.xml	(revision 4996)
+++ pjproject/trunk/pjsip-apps/src/swig/java/android/AndroidManifest.xml	(revision 4997)
@@ -10,4 +10,5 @@
 
     <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.CAMERA" />
     <uses-permission android:name="android.permission.RECORD_AUDIO" />
     <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
Index: pjproject/trunk/pjsip-apps/src/swig/java/android/res/layout/activity_call.xml
===================================================================
--- pjproject/trunk/pjsip-apps/src/swig/java/android/res/layout/activity_call.xml	(revision 4996)
+++ pjproject/trunk/pjsip-apps/src/swig/java/android/res/layout/activity_call.xml	(revision 4997)
@@ -39,3 +39,8 @@
         android:text="Reject" />
 
+    <SurfaceView
+        android:id="@+id/surfaceIncomingVideo"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+
 </LinearLayout>
Index: pjproject/trunk/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/CallActivity.java
===================================================================
--- pjproject/trunk/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/CallActivity.java	(revision 4996)
+++ pjproject/trunk/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/CallActivity.java	(revision 4997)
@@ -22,4 +22,6 @@
 import android.os.Handler;
 import android.os.Message;
+import android.view.SurfaceHolder;
+import android.view.SurfaceView;
 import android.view.View;
 import android.widget.Button;
@@ -29,5 +31,7 @@
 import org.pjsip.pjsua2.*;
 
-public class CallActivity extends Activity implements Handler.Callback {
+public class CallActivity extends Activity
+	implements Handler.Callback, SurfaceHolder.Callback
+{
 	
 	public static Handler handler_;
@@ -40,4 +44,12 @@
 		super.onCreate(savedInstanceState);
 		setContentView(R.layout.activity_call);
+		
+		SurfaceView surfaceView = (SurfaceView)findViewById(R.id.surfaceIncomingVideo);
+		if (MainActivity.currentCall == null ||
+			MainActivity.currentCall.vidWin == null)
+		{
+			surfaceView.setVisibility(View.GONE);
+		}
+		surfaceView.getHolder().addCallback(this);
 		
 		handler_ = handler;
@@ -59,5 +71,31 @@
     	handler_ = null;
     }
-	
+
+    private void updateVideoWindow(SurfaceHolder holder) {
+		if (MainActivity.currentCall != null &&
+			MainActivity.currentCall.vidWin != null)
+		{
+			VideoWindowHandle vidWH = new VideoWindowHandle();
+			if (holder == null)
+				vidWH.getHandle().setWindow(null);
+			else
+				vidWH.getHandle().setWindow(pjsua2.android_opengl_get_surface(holder.getSurface()));
+			try {
+				MainActivity.currentCall.vidWin.setWindow(vidWH);
+			} catch (Exception e) {}
+		}
+    }
+    
+	public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
+		updateVideoWindow(holder);
+    }
+
+    public void surfaceCreated(SurfaceHolder holder) {
+    }
+
+    public void surfaceDestroyed(SurfaceHolder holder) {
+    	updateVideoWindow(null);
+    }
+    
 	public void acceptCall(View view) {
 		CallOpParam prm = new CallOpParam();
@@ -87,4 +125,12 @@
 	}
 	
+	private void setupVideoSurface() {
+
+		SurfaceView surfaceView = (SurfaceView)findViewById(R.id.surfaceIncomingVideo);
+		surfaceView.setVisibility(View.VISIBLE);
+		updateVideoWindow(surfaceView.getHolder());
+		
+	}
+	
 	@Override
 	public boolean handleMessage(Message m) {
@@ -95,4 +141,11 @@
 			updateCallState(lastCallInfo);
 			
+		} else if (m.what == MainActivity.MSG_TYPE.CALL_MEDIA_STATE) {
+			
+			if (MainActivity.currentCall.vidWin != null) {
+				/* If there's incoming video, display it. */
+				setupVideoSurface();
+			}
+
 		} else {
 			
Index: pjproject/trunk/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MainActivity.java
===================================================================
--- pjproject/trunk/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MainActivity.java	(revision 4996)
+++ pjproject/trunk/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MainActivity.java	(revision 4997)
@@ -62,4 +62,5 @@
 		public final static int REG_STATE = 3;
 		public final static int BUDDY_STATE = 4;
+		public final static int CALL_MEDIA_STATE = 5;
 	}
 
@@ -171,4 +172,12 @@
 			if (CallActivity.handler_ != null) {
 				Message m2 = Message.obtain(CallActivity.handler_, MSG_TYPE.CALL_STATE, ci);
+				m2.sendToTarget();
+			}
+			
+		} else if (m.what == MSG_TYPE.CALL_MEDIA_STATE) {
+			
+			/* Forward the message to CallActivity */
+			if (CallActivity.handler_ != null) {
+				Message m2 = Message.obtain(CallActivity.handler_, MSG_TYPE.CALL_MEDIA_STATE, null);
 				m2.sendToTarget();
 			}
@@ -333,8 +342,5 @@
 		
 		MyCall call = new MyCall(account, -1);
-		CallOpParam prm = new CallOpParam();
-		CallSetting opt = prm.getOpt();
-		opt.setAudioCount(1);
-		opt.setVideoCount(0);
+		CallOpParam prm = new CallOpParam(true);
 
 		try {
@@ -503,4 +509,9 @@
 	}
 	
+	public void notifyCallMediaState(MyCall call) {
+		Message m = Message.obtain(handler, MSG_TYPE.CALL_MEDIA_STATE, null);
+		m.sendToTarget();
+	}
+	
 	public void notifyBuddyState(MyBuddy buddy) {
 		Message m = Message.obtain(handler, MSG_TYPE.BUDDY_STATE, buddy);
Index: pjproject/trunk/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MyApp.java
===================================================================
--- pjproject/trunk/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MyApp.java	(revision 4996)
+++ pjproject/trunk/pjsip-apps/src/swig/java/android/src/org/pjsip/pjsua2/app/MyApp.java	(revision 4997)
@@ -29,4 +29,5 @@
 	abstract void notifyIncomingCall(MyCall call);
 	abstract void notifyCallState(MyCall call);
+	abstract void notifyCallMediaState(MyCall call);
 	abstract void notifyBuddyState(MyBuddy buddy);
 }
@@ -42,6 +43,9 @@
 
 class MyCall extends Call {
+	public VideoWindow vidWin;
+	
 	MyCall(MyAccount acc, int call_id) {
 		super(acc, call_id);
+		vidWin = null;
 	}
 
@@ -87,6 +91,13 @@
 					continue;
 				}
-			}
-		}
+			} else if (cmi.getType() == pjmedia_type.PJMEDIA_TYPE_VIDEO &&
+				       cmi.getStatus() == pjsua_call_media_status.PJSUA_CALL_MEDIA_ACTIVE &&
+				       cmi.getVideoIncomingWindowId() != pjsua2.INVALID_ID)
+			{
+				vidWin = cmi.getVideoWindow();
+			}
+		}
+		
+		MyApp.observer.notifyCallMediaState(this);
 	}
 }
Index: pjproject/trunk/pjsip-apps/src/swig/java/sample.java
===================================================================
--- pjproject/trunk/pjsip-apps/src/swig/java/sample.java	(revision 4996)
+++ pjproject/trunk/pjsip-apps/src/swig/java/sample.java	(revision 4997)
@@ -45,4 +45,7 @@
 	
 	@Override
+	public void notifyCallMediaState(MyCall call) {
+	}
+
 	public void notifyCallState(MyCall call) {
 		if (currentCall == null || call.getId() != currentCall.getId())
