views:

51

answers:

0

Hi friends

I am using android inbuilt camera to take picture and then attaching the same picture to email, when i am testing this functionality in 1.6 device, i am able name the picture that to be taken by in built camera, but in 2.1, the picture is having a name i.e given by device,

How to give user defined name in 2.1 inbuilt camera images..

to avoid that problem i am saving the image manually but when i try to get the image back through intent as bitmap and then saving it to sd card using compress method

this methods handles result from inbuilt camera

protected void onActivityResult(int requestCode, int resultCode, Intent data) { File file = new File(Environment.getExternalStorageDirectory() + "/test.png"); switch (requestCode) { case PHOTO_ACTION: if (resultCode == RESULT_CANCELED) { addPhoto = false; Toast.makeText(this, "Canceled ", Toast.LENGTH_LONG).show(); break; } else if (resultCode == RESULT_OK) { Bundle b = data.getExtras(); Bitmap bm = (Bitmap) b.get("data");

FileOutputStream out;
try
 {

 out = new FileOutputStream(file);
 bm.compress(Bitmap.CompressFormat.JPEG, 100, out);
 out.flush();
 out.close();
 scanPhoto(file.toString());
 out = null;
 addPhoto = true;
 } catch (Exception e)
  {
   e.printStackTrace();
   addPhoto = false;
  }

but when i am storing like this i am getting two images. one with system given name and other with name given by me. but the image one which has user defined is having less resolution so i question is how to save the bitmap with more resolution with out compressing it .. please help.... me