i have create an android application that will capture picture and save in sdcard folder,now i want to save the image with a custom name.
import java.io.Byte
You need to put fileName as Intent Extras -
cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, "android.jpg");
this article maybe useful, try it.
& this as well, the only different that he used the date as a default name. change it.
It usually works :)
File outFile = new File(Environment.getExternalStorageDirectory(), "myname.jpeg");
FileOutputStream fos = new FileOutputStream(outFile);
photo.compress(Bitmap.CompressFormat.JPEG, 100, fos);
fos.flush();
fos.close();
you would also need to add Permission in Android Manifest.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
the snippet will save the content of photo
inside /sdcard
with the name "myname.jpeg"