Image getting saved in android phone is black...urgent help

All your problems with Audio, Video and Images.

Image getting saved in android phone is black...urgent help

Postby manishsharma2k2 » Tue Jul 21, 2009 6:56 am

Hi All,

I am trying to save the image in the sdcard. Incase of emulator it is working fine but in case of phone it is showing some black frame is getting saved.]

Bitmap mypic=Bitmap.createBitmap(2048,1536,Bitmap.Config.RGB_565);


onPictureTaken(byte[] data, Camera c) {
mypic = BitmapFactory.decodeByteArray(data, 0, data.length);

ContentValues values = new ContentValues();
values.put(Images.Media.TITLE, "title");
values.put(Images.Media.BUCKET_ID, "test");
values.put(Images.Media.DESCRIPTION, "test Image taken");
values.put(Images.Media.MIME_TYPE, "image/jpeg");
Uri imageUri = getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, values);
Log.v(TAG," After URI");
OutputStream outstream;

outstream = getContentResolver().openOutputStream(imageUri);
mypic.compress(CompressFormat.JPEG, 100, outstream);

}

In case of emulator it is working fine.But in phone it is showing black image.

Plz reply its urgent.
manishsharma2k2
Freshman
Freshman
 
Posts: 2
Joined: Thu Jul 09, 2009 12:27 pm

Top

Postby TheChosen » Tue Jul 21, 2009 3:07 pm

Did you include the permission tags in your manifest file so that you are able to save onto the SD card?

Is an image file created which contains only black pixels or is no image file created at all and only the device shows a black display?
TheChosen
Experienced Developer
Experienced Developer
 
Posts: 62
Joined: Tue Jan 06, 2009 7:18 pm
Location: Germany

Postby manishsharma2k2 » Thu Jul 23, 2009 5:18 am

Did you include the permission tags in your manifest file so that you are able to save onto the SD card?

I didnt include any permissions in manifest file. What permissions are we supposed to include for that.

Is an image file created which contains only black pixels or is no image file created at all and only the device shows a black display?

Actually the size of the file around 52K.I am not sure whether the data I am getting frm the JPEG call back is getting saved in the bitmap I am creating.
onPictureTaken(byte[] data, Camera c)

Because the data.length is different from the size of bitmap.
manishsharma2k2
Freshman
Freshman
 
Posts: 2
Joined: Thu Jul 09, 2009 12:27 pm

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: No registered users and 21 guests