From d47681e20e73238517cdc9f36cb318b2120e04f8 Mon Sep 17 00:00:00 2001 From: Christophe BOUCAUT Date: Thu, 20 Nov 2014 15:40:30 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20du=20path=20de=20stockag?= =?UTF-8?q?e=20des=20photos=20+=20ajout=20des=20permissions=20lors=20de=20?= =?UTF-8?q?l'installation=20du=20plugin.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.xml | 1 + .../src/org/geneanet/customcamera/CameraView.java | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/plugin.xml b/plugin.xml index 6814086..50b1429 100644 --- a/plugin.xml +++ b/plugin.xml @@ -23,6 +23,7 @@ + diff --git a/src/android/customCamera/src/org/geneanet/customcamera/CameraView.java b/src/android/customCamera/src/org/geneanet/customcamera/CameraView.java index 83f42a1..e033f6e 100644 --- a/src/android/customCamera/src/org/geneanet/customcamera/CameraView.java +++ b/src/android/customCamera/src/org/geneanet/customcamera/CameraView.java @@ -10,6 +10,7 @@ import java.util.List; import android.app.Activity; import android.app.AlertDialog; +import android.content.ContentValues; import android.content.res.Configuration; import android.hardware.Camera; import android.hardware.Camera.PictureCallback; @@ -337,9 +338,10 @@ public class CameraView extends Activity { accepter.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - try { - outStream = new FileOutputStream(Environment.getExternalStorageDirectory().getPath() + String.format( - "/%d.jpg", System.currentTimeMillis())); + try { + String pathImg = Environment.getExternalStorageDirectory().getPath()+"/"+Environment.DIRECTORY_DCIM+"/Camera/"; + pathImg = pathImg+String.format("%d.jpeg", System.currentTimeMillis()); + outStream = new FileOutputStream(pathImg); outStream.write(data); outStream.close(); keepPhoto.setVisibility(View.INVISIBLE); @@ -362,6 +364,6 @@ public class CameraView extends Activity { }; }; mCamera.takePicture(shutterCallback, rawCallback, jpegCallback); - } + } }