title: Camera on Android emulator doesn't work
body: <p>I'm a begginer android programmer and I have a problem with the camera. What I'm trying to do is to get a preview on the camera. The problem is, Camera.open() always returns null. The code goes like this:</p>
  
  <p>CameraPreview.java</p>
  
  <pre><code>public class CameraPreview extends Activity implements SurfaceHolder.Callback
  {
      protected void onCreate(Bundle savedInstanceState) {
  
          super.onCreate(savedInstanceState);
  
          setContentView(R.layout.activity_camera_preview);
  
          SurfaceHolder holder;
          SurfaceView preview = (SurfaceView) findViewById(R.id.surface1);
          holder = preview.getHolder();
          holder.addCallback(this);
          holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
  
          Camera camera = Camera.open();
          if(camera!=null)
          {
              try 
              {
                  camera.setPreviewDisplay(holder);
              } 
              catch (IOException e) 
              {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
              camera.startPreview();
          }
      }
  
      @Override
      public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
          // TODO Auto-generated method stub      
      }
  
      @Override
      public void surfaceCreated(SurfaceHolder holder) {
          // TODO Auto-generated method stub
  
      }
  
      @Override
      public void surfaceDestroyed(SurfaceHolder holder) {
          // TODO Auto-generated method stub
  
      }
  }
  </code></pre>
  
  <p>AndroidManifest.xml</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.paparazzi"
  android:versionCode="1"
  android:versionName="1.0" &gt;
  &lt;uses-sdk
      android:minSdkVersion="8"
      android:targetSdkVersion="15" /&gt;
  &lt;uses-permission android:name="android.permission.CAMERA" /&gt;
  &lt;application
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/AppTheme" &gt;
      &lt;activity
          android:name=".MainActivity"
          android:label="@string/title_activity_main" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity android:name=".CameraPreview"&gt; &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>
  
  <p>emulator config:</p>
  
  <pre><code>hw.lcd.density=240
  hw.cpu.arch=arm
  skin.name=WVGA800
  sdcard.size=64M
  abi.type=armeabi-v7a
  hw.camera.back=emulated
  image.sysdir.1=system-images\android-16\armeabi-v7a\
  hw.gpu.enabled=yes
  hw.camera.front=emulated
  skin.path=platforms\android-16\skins\WVGA800
  hw.cpu.model=cortex-a8
  vm.heapSize=48
  hw.ramSize=512
  </code></pre>
  
  <p>I use eclipse with android plugin and the newest sdk. I would really appreciate any suggestions.</p>