简体   繁体   中英

simulating an SD card in Android emulator for Camera pictures

Hey guys I am mimicking a camera on the Android emulator with my webcam. It ask that I insert an SD card before using the camera. I was wondering if it is possible to create a 'virtual' in sense SD Card so the camera can work? Under the emulator options I specify an SD storage area of 20MB so I am not sure why this is not working?

Here is how I am accessing the camera:

..listener...onClick...{
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
                startActivityForResult(takePictureIntent, CAMERA_PIC_REQUEST);
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == CAMERA_PIC_REQUEST) { 
            if (resultCode == RESULT_OK) {
                Bitmap bm = BitmapFactory.decodeFile(imagePath);

                ImageView image = (ImageView) findViewById(R.id.gimg1);
                image.setImageBitmap(bm);
            } else if (resultCode == RESULT_CANCELED){

            }
        }  
.....
}

Thoughts an suggestions appreciate!

David

UPDATE:

I simply had to update the 20MB to a higher storage rate and it worked great :)

I had the same problem, but my SD card was configured with 200MB and was definitely active. What caused the problem was that "Internal Storage" was also configured with 200MB. Increasing Internal Storage fixed the problem.

http://i.imgur.com/EMRcYdz.png

我只需要将20MB更新到更高的存储速率,它工作得很好!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM