Create multiply photo with Android SDK and save there

Create multiply photo with Android SDK and save there

Numerous manual describes how to take a single photo and get his data(uri or Bundlee) in Activity in method onActivityResult. How to make a few photos and get this result in the Activity??? We can create own realization of SurfaceHolder, Camera etc… And we can create standart Action to call standart Camera application and… get all photos. In this very short state, we will show how

CameraEventReceiver.NEED_LISTEN = true;
Intent intent = new Intent(


its own Intent. We can call his from button

Receiver, who listen adding new photos to MediaStore from camera.

public class CameraEventReceiver extends BroadcastReceiver {

    public static boolean NEED_LISTEN = false;

    public void onReceive(Context context, Intent intent) {
                Uri currenturi = intent.getData();
                String pathPhoto = getPath(context,currenturi);
                File sourceFile = new File(pathPhoto);
                File f = new File(Environment.getExternalStorageDirectory()+File.separator+"OwnFolder", sourceFile.getName());
                 * Here we can save photos in our storage or do with it whatever we like


    public static String getPath(Context context, Uri uri){

        String[] projection = { MediaStore.Images.Media.DATA };
        Cursor cursor = context.getContentResolver().query(uri, projection, null, null, null);
        if (cursor == null) return null;
           int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
           String s=cursor.getString(column_index);
           return s;


and do not forget to add a listener to the manifest

<action android:name=""/>
<action android:name="android.hardware.action.NEW_PICTURE" />
<data android:mimeType="image/*"/>


It’s all!!!

Leave a Reply

Please disable your adblocker or whitelist this site!