Save captured image - android

I have been trying to work this out but not having any success.
I have a really simple app that captures an image and displays that image to the user. The problem is that it saves the image as the date is was captured, but instead I want to give the image a specific name.
Here is my code:
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
this.imageView = (ImageView)this.findViewById(R.id.imageView1);
Button photoButton = (Button) this.findViewById(R.id.button1);
photoButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
//intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, CAMERA_REQUEST);
}
});
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
System.gc();
if (requestCode == CAMERA_REQUEST) {
Bitmap photo = (Bitmap) data.getExtras().get("data");
imageView.setImageBitmap(photo);
}
}
I would really appreciate it if someone could show me what I need to add and where to set the image name.

Try the below code is one of the solution to your problem::
static Uri capturedImageUri=null;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
this.imageView = (ImageView)this.findViewById(R.id.imageView1);
Button photoButton = (Button) this.findViewById(R.id.button1);
photoButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Calendar cal = Calendar.getInstance();
File file = new File(Environment.getExternalStorageDirectory(), (cal.getTimeInMillis()+".jpg"));
if(!file.exists()){
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
file.delete();
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
capturedImageUri = Uri.fromFile(file);
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(MediaStore.EXTRA_OUTPUT, capturedImageUri);
startActivityForResult(i, CAMERA_RESULT);
}
});
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_REQUEST) {
//Bitmap photo = (Bitmap) data.getExtras().get("data");
//imageView.setImageBitmap(photo);
try {
Bitmap bitmap = MediaStore.Images.Media.getBitmap( getApplicationContext().getContentResolver(), capturedImageUri);
imageView.setImageBitmap(bitmap);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

Related

Android name image programmatically

I want to give a custom name to the image captured through the camera programmatically. I have used the snippets of codes given here how to control/save images took with android camera programmatically? but it still doesn't work and the image is stored with the default name. Why?
public class MainActivity extends Activity {
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button cameraButton = (Button) findViewById(R.id.takepicture);
cameraButton.setOnClickListener( new OnClickListener(){
public void onClick(View v ){
//Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
//startActivityForResult(intent,0);
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
Uri mUri = Uri.fromFile(new File(Environment.getExternalStorageDirectory(),
"pic_"+ String.valueOf(System.currentTimeMillis()) + ".jpg"));
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT, mUri);
startActivityForResult(intent,0);
}
});
}
}
You can try as follows...
Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
String fullPath = "";
File imageFile = null;
String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
String pictureName = "IMG_" + timeStamp + ".jpg";
fullPath = Environment.getExternalStorageDirectory() + "/ImageFolder/" + pictureName;
File dir = new File(Environment.getExternalStorageDirectory() + "/ImageFolder/");
dir.mkdirs();
imageFile = new File(fullPath);
takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(imageFile));
startActivityForResult(takePictureIntent, 1);
Try this: Here I saved image with current date and time as name:
public class CameraActivity extends Activity {
private static final int CAMERA_REQUEST = 0;
static Uri capturedImageUri=null;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_junit_test);
Button cameraButton = (Button) findViewById(R.id.cameraButton);
cameraButton.setOnClickListener( new OnClickListener(){
private int CAMERA_RESULT;
public void onClick(View v ){
Calendar cal = Calendar.getInstance();
File file = new File(Environment.getExternalStorageDirectory(), (cal.getTimeInMillis()+".jpg"));
if(!file.exists()){
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
file.delete();
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
capturedImageUri = Uri.fromFile(file);
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(MediaStore.EXTRA_OUTPUT, capturedImageUri);
startActivityForResult(i, CAMERA_RESULT);
}
});
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_REQUEST) {
//Bitmap photo = (Bitmap) data.getExtras().get("data");
//imageView.setImageBitmap(photo);
try {
Bitmap bitmap = MediaStore.Images.Media.getBitmap( getApplicationContext().getContentResolver(), capturedImageUri);
//imageView.setImageBitmap(bitmap);
Toast.makeText(this, "Image Saved As"+bitmap, Toast.LENGTH_SHORT).show();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
Try This
public void CapturePhoto()
{
try
{
myFilesDir = new File( getFilesDir()+"/MyDir");
if(! mfilesDir.exists() )
myFilesDir.mkdirs();
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(android.provider.MediaStore.EXTRA_OUTPUT,Uri.fromFile(new File(myFilesDir.toString()+"/temp.jpeg")));
startActivityForResult(intent, CAPTURE_IMAGE_CALLBACK);
}
catch ( ActivityNotFoundException e )
{
Log.e( TAG, "No camera: " + e );
}
catch ( Exception e )
{
Log.e( TAG, "Cannot make photo: " + e );
}
}`

open an camera app by intent and save picture on the SD and imageView [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Using Camera and storing captured result in SDCard in android
I want to get picture from camera app, save it on SD and set imageView.
I made a code below. saving and imageView sometimes works. but sometimes the picture is saved on SD and imageView doesn't work.
When imageView doesn't work, it seems that mOutUri become null in onActivityResult.
I have tried to save a mOutUri on SharedPreferences in clkbutton. I can see the uri in onActivityResult but imageView doesn't work. at this time, mOutUri is also null.
public void clkbutton(View v){
Intent intent = new Intent();
// open camera app
intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
// save data in SD card
Date date = new Date();
DateFormat df = new SimpleDateFormat("yyyy-MM-dd-kk-mm-ss");
String newPicFile = df.format(date) + ".jpg";
mNewPicFile = newPicFile;
String outPath = "/sdcard/" + newPicFile;
File outFile = new File(outPath);
mOutUri = Uri.fromFile(outFile);
intent.putExtra(MediaStore.EXTRA_OUTPUT, mOutUri);
startActivityForResult(intent, REQUEST_CAPTURE_IMAGE);
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
ImageView imageView = (ImageView) findViewById(R.id.image_view);
imageView.setImageURI(mOutUri);
}
It's so weird that it sometimes errors and sometimes works.
In onActivityResult before you setImageUri you should check if file exists. You can lose mOutUri content when app changes orientation, and it happend sometime when you open camera. You should implement in activity onSaveInstanceState where you store into preferences your uri and onRestoreInstanceState where you restore your uri.
try the following code:
static Uri capturedImageUri=null;
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
this.imageView = (ImageView)this.findViewById(R.id.imageView1);
Button photoButton = (Button) this.findViewById(R.id.button1);
photoButton.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Calendar cal = Calendar.getInstance();
File file = new File(Environment.getExternalStorageDirectory(), (cal.getTimeInMillis()+".jpg"));
if(!file.exists()){
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
file.delete();
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
capturedImageUri = Uri.fromFile(file);
Intent i = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
i.putExtra(MediaStore.EXTRA_OUTPUT, capturedImageUri);
startActivityForResult(i, CAMERA_RESULT);
}
});
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_REQUEST) {
//Bitmap photo = (Bitmap) data.getExtras().get("data");
//imageView.setImageBitmap(photo);
try {
Bitmap bitmap = MediaStore.Images.Media.getBitmap( getApplicationContext().getContentResolver(), capturedImageUri);
imageView.setImageBitmap(bitmap);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
and also dont forget to add some permissions in android manifets file like:
`note: add permission WRITE_EXTERNAL_STORAGE in manifest file.`

How to show the captured image on the activity and simultaneously save it in the phone and inside the sqlite database?

I have taken a reference of capturing the image and saving it into SD Card. That is working fine. Now i want the image will show onto the activity until i click the button.
Can anybody suggest me that how to make it possible????
Here I am pasting the code. Kindly tell me where I am doing wrong here..
The DVCamera.class
public class DVCameraActivity extends Activity {
static Uri capturedImageUri=null;
Button ButtonClick1,ButtonClick2;
ImageView image1,image2;
int CAMERA_PIC_REQUEST = 2;
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
ButtonClick1 =(Button) findViewById(R.id.buttonClick1);
ButtonClick2 = (Button) findViewById(R.id.buttonClick2);
image2 =(ImageView) findViewById(R.id.PhotoCaptured2);
image1 =(ImageView) findViewById(R.id.PhotoCaptured1);
ButtonClick1.setOnClickListener(new OnClickListener (){
#Override
public void onClick(View view)
{
Calendar cal = Calendar.getInstance();
File file = new File(Environment.getExternalStorageDirectory(), (cal.getTimeInMillis()+".jpg"));
if(!file.exists()){
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
file.delete();
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
capturedImageUri = Uri.fromFile(file);
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
// request code
//cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, capturedImageUri);
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
}
});
ButtonClick2.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
Calendar cal = Calendar.getInstance();
File file = new File(Environment.getExternalStorageDirectory(), (cal.getTimeInMillis()+".jpg"));
if(!file.exists()){
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
file.delete();
try {
file.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
// TODO Auto-generated method stub
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
// request code
//cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, capturedImageUri);
capturedImageUri = Uri.fromFile(file);
startActivityForResult(cameraIntent, 1337);
}
});
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{
if( requestCode == CAMERA_PIC_REQUEST)
{
// data.getExtras()
Bitmap bitmap = null;
try {
bitmap = MediaStore.Images.Media.getBitmap( getApplicationContext().getContentResolver(), capturedImageUri);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
image1.setImageBitmap(bitmap);
}
else if(requestCode == 1337)
{
Bitmap bitmap = null;
try {
bitmap = MediaStore.Images.Media.getBitmap( getApplicationContext().getContentResolver(), capturedImageUri);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
image2.setImageBitmap(bitmap);
}
else
{
Toast.makeText(DVCameraActivity.this, "Picture NOt taken", Toast.LENGTH_LONG).show();
}
super.onActivityResult(requestCode, resultCode, data);
}
}
And hre is the layout file
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="#+id/buttonClick1"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="Click for Photo1" />
<Button
android:id="#+id/buttonClick2"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:text="Click for Photo2" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageView
android:id="#+id/PhotoCaptured1"
android:layout_width="150dp"
android:layout_height="200dp" />
<ImageView
android:id="#+id/PhotoCaptured2"
android:layout_width="150dp"
android:layout_height="200dp" />
</LinearLayout>
<!--
<FrameLayout
android:id="#+id/camera_preview"
android:layout_gravity="center"
android:layout_width="200dp"
android:layout_height="200dp"
/>
-->
</LinearLayout>
And if any1 can suggest me that what i have to do to save the captured image in the database,that will be another advantage for me.
Thanks in advance..
you can start camera on button like this..
ButtonClick2.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
}
});
and then..
protected void onActivityResult(int requestCode, int resultcode, Intent intent)
{
super.onActivityResult(requestCode, resultcode, intent);
if (requestCode == CAMERA_REQUEST) {
Bitmap photo = (Bitmap) intent.getExtras().get("data");
image1.setImageBitmap(bitmap);
}
}
I think this may help you.
You should check out Google training for getting the full size image stored and read from SD card and for the image to database use SQLite database where you need to store address where the file is. And when you want the picture to be shown read the database and use code from google training to get the picture from SD.
Hope it helped.
I think when u capture image there is two option "save" and "discard",
click on save button then it automatically save in sdcard.
This code is for save image in database.
ByteArrayOutputStream baos = new ByteArrayOutputStream();
camaraBitmap.compress(Bitmap.CompressFormat.PNG, 100, baos);
byte[] data = baos.toByteArray();
for(int i=0;i<yourCursorLastPosition;i++){
cursor.moveToPosition(i);
ContentValues cv = new ContentValues(imageColumnNo);
cv.put(MyDbHelper.COL_IMG, data);
mdb.insert(MyDbHelper.TABLE_NAME, null, cv);
}

Save image view as a jpeg image in sdcard

public class MapDemoActivity extends Activity {
Button capture;
ImageView image;
int cameracode=100;
Bitmap bm;
Boolean result;
FileOutputStream fos;
/** Called when the activity is first created. */
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
capture=(Button)findViewById(R.id.capture);
capture.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
image=(ImageView)findViewById(R.id.image);
Intent i=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, cameracode);
image.setDrawingCacheEnabled(true);
bm = image.getDrawingCache();
try {
fos = new FileOutputStream("sdcard/image.jpg");
result=bm.compress(CompressFormat.JPEG, 75, fos);
fos.flush();
fos.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
if(requestCode==100)
{
bm=(Bitmap) data.getExtras().get("data");
image.setImageBitmap(bm);
}
super.onActivityResult(requestCode, resultCode, data);
}
}
In this prog i am capturing image from camera & display to Image view then i am trying to
convert it to Jpeg to store in sdcard...
But when i pressed capture image Button prog get force close..
& empty jpeg file created in sdcard... i want to store jpeg file to sdcard
startActivityForResult is an asynchronous call, therefore everything that you have right after that call is executed immediately, before waiting for the capture to complete. Instead of having it that way, you should move the saving code into the onActivityResult.
Additionally, you should not hardcode sdcard but instead use Environment.getExternalStorageDirectory() instead.
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
capture=(Button)findViewById(R.id.capture);
capture.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
// TODO Auto-generated method stub
image=(ImageView)findViewById(R.id.image);
Intent i=new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i, cameracode);
}
});
}
#Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
if(requestCode==100)
{
bm=(Bitmap) data.getExtras().get("data");
image.setImageBitmap(bm);
if(bm == null) {
return; //probably user cancelled;
}
try {
fos = new FileOutputStream(new File(Environment.getExternalStorageDirectory(), "image.jpg"));
result=bm.compress(CompressFormat.JPEG, 75, fos);
fos.flush();
fos.close();
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
super.onActivityResult(requestCode, resultCode, data);
}
Finally, you may want to check that you actually got an image before trying to save it, as the user may have cancelled image capture.
Apart from it, I suggest that you post your full logcat stack trace. Maybe there's something else sinister in there.
Try changing your target directory to this:
try {
fos = new FileOutputStream("/mnt/sdcard/MyActivity/image.jpg");
result=bm.compress(CompressFormat.JPEG, 75, fos);
fos.flush();
fos.close();
Make sure you create your directory before writing to it as well.
String dir = "/mnt/sdcard/MyActivity/";
directory = new File(dir);
if (!directory.exists()) {
directory.mkdirs();
}
I think that the part of code after startActivityForResult is executed, and the bitmap is not yet available. You should save it directly on the onActivityResult.
Futhermore, have you ask Android to save you image by giving the intent this :
final Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(getTempFile(this)) );
startActivityForResult(intent, TAKE_PHOTO_CODE);
getTempFile is a function which returns me the path I want.
PS: Have you ask for the permission in the manifest ? You need
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA" />

camera activity gives null pointer exception

in my camera intent:
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
this part gives me a null pointer exception.
can anyone explain why and what need to be changed??
button_1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent("android.media.action.IMAGE_CAPTURE");
fileUri = getOutputMediaFileUri(MEDIA_TYPE_IMAGE); // create a file to save the image
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri); // set the image file name
startActivityForResult(intent, TAKE_PICTURE);
}
});
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == REQUEST_CODE) {
if (resultCode == RESULT_OK) {
// Image captured and saved to fileUri specified in the Intent
Toast.makeText(this, "Image saved to:\n" +
data.getData(), Toast.LENGTH_LONG).show();
} else if (resultCode == RESULT_CANCELED) {
// User cancelled the image capture
} else {
// Image capture failed, advise user
}
}
}
Try the following,
public class Camera extends Activity
{
private static final int CAMERA_REQUEST = 1888;
private String selectedImagePath;
WebView webview;
String fileName = "capturedImage.jpg";
private static Uri mCapturedImageURI;
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
Intent cameraIntent = new Intent(ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
}
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
if (resultCode == RESULT_OK) {
if (requestCode == CAMERA_REQUEST)
{
Bitmap photo = (Bitmap) data.getExtras().get("data");
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
photo.compress(Bitmap.CompressFormat.JPEG, 40, bytes);
Random randomGenerator = new Random();randomGenerator.nextInt();
String newimagename=randomGenerator.toString()+".jpg";
File f = new File(Environment.getExternalStorageDirectory()
+ File.separator + newimagename);
try {
f.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//write the bytes in file
try {
fo = new FileOutputStream(f.getAbsoluteFile());
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
fo.write(bytes.toByteArray());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
uri=f.getAbsolutePath();
//this is the url that where you are saved the image
}
}

Categories

Resources