Estou usando quase da mesma forma que vc, alterando apenas a forma de recuperar a imagem:
File diretorio = new File(PATH);
if (! diretorio.exists()) {
diretorio.mkdir();
}
foto = new File(PATH + sdf.format(new Date()) + ".jpg");
Uri outputFileUri = Uri.fromFile(foto);
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra( MediaStore.EXTRA_OUTPUT, outputFileUri );
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
e no result:
Bundle bundle = data.getExtras();
if (bundle != null) {
// Recupera o bitmap retornado pela câmera
Bitmap image = (Bitmap) bundle.get("data");
ivImagem.setImageBitmap(image);
caminhoFoto = foto.getAbsolutePath();
}
o erro ocorre na hora de abrir a camera ou depois de tirar a foto?
Estou usando intent.
Intent it = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
it.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(caminhoFoto));
startActivityForResult(it, 1);
aí no result eu faço:
fotoTirada = BitmapFactory.decodeFile(caminhoFoto.getAbsolutePath());
imageView1.setImageBitmap(fotoTirada);
On 24 out, 15:54, Victor Fugiwara <victorfugiw...@gmail.com> wrote:
> vc tá usando a API da câmera ou chamando ela via Intent?
>
> On Mon, Oct 24, 2011 at 2:37 PM, leonardo_series <
>
>
>
>
>
>
>
> leonardo_verissi...@hotmail.com> wrote:
> > Adicionei sim. Estas são todas as permissões que estou usando:
>
> > <uses-permission
> > android:name="android.permission.ACCESS_FINE_LOCATION"></uses-
> > permission>
> > <uses-permission android:name="android.permission.INTERNET"></uses-
> > permission>
> > <uses-permission
> > android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-
> > permission>
> > <uses-permission
> > android:name="android.permission.WRITE_OWNER_DATA"></uses-permission>
> > <uses-permission
> > android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-
> > permission>
> > <uses-permission android:name="android.permission.RECORD_AUDIO"></
> > uses-permission>
> > <uses-permission android:name="android.permission.CAMERA"></uses-
> > permission>
> > <uses-feature android:name="android.hardware.camera"></uses-
> > feature>
>
> > On 24 out, 14:19, Thiago Lopes Rosa <thiago.r...@gmail.com> wrote:
> > > Você adicionou a permissão de camera?
>
> > > Thiago
>
> > > On Mon, Oct 24, 2011 at 15:12, leonardo_series <
>
> > > leonardo_verissi...@hotmail.com> wrote:
> > > > Gente, não é possível, toda vez que tento tirar uma foto não consigo,
> > > > já baixei tantos códigos ensinando a fazer isso, mas nunca consigo,
> > > > toda vez da o mesmo erro, será que alguém sabe q erro é esse?
>
> > > > 10-24 16:47:25.351: ERROR/Zygote(33): setreuid() failed. errno: 2
>
> > > > 10-24 16:47:34.571: ERROR/Zygote(33): setreuid() failed. errno: 17
>
> > > > 10-24 16:47:37.351: ERROR/BatteryService(59): usbOnlinePath not found
>
> > > > 10-24 16:47:37.351: ERROR/BatteryService(59): batteryVoltagePath not
> > > > found
>
> > > > 10-24 16:47:37.351: ERROR/BatteryService(59): batteryTemperaturePath
> > > > not found
>
> > > > 10-24 16:47:37.381: ERROR/SurfaceFlinger(59): Couldn't open /sys/power/
> > > > wait_for_fb_sleep or /sys/power/wait_for_fb_wake
>
> > > > 10-24 16:47:47.711: ERROR/EventHub(59): could not get driver version
> > > > for /dev/input/mouse0, Not a typewriter
>
> > > > 10-24 16:47:47.721: ERROR/EventHub(59): could not get driver version
> > > > for /dev/input/mice, Not a typewriter
>
> > > > 10-24 16:47:48.180: ERROR/System(59): Failure starting core service
> > > > 10-24 16:47:48.180: ERROR/System(59): java.lang.SecurityException
>
> > > > 10-24 16:47:48.180: ERROR/System(59): at
> > > > android.os.BinderProxy.transact(Native Method)
>
> > > > 10-24 16:47:48.180: ERROR/System(59): at
> > > > android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:
> > > > 146)
> > > > 10-24 16:47:48.180: ERROR/System(59): at
> > > > android.os.ServiceManager.addService(ServiceManager.java:72)
>
> > > > 10-24 16:47:48.180: ERROR/System(59): at
> > > > com.android.server.ServerThread.run(SystemServer.java:184)
>
> > > > 10-24 16:47:49.541: ERROR/SoundPool(59): error loading /system/media/
> > > > audio/ui/Effect_Tick.ogg
>
> > > > 10-24 16:47:49.560: ERROR/SoundPool(59): error loading /system/media/
> > > > audio/ui/KeypressStandard.ogg
>
> > > > 10-24 16:47:49.571: ERROR/SoundPool(59): error loading /system/media/
> > > > audio/ui/KeypressSpacebar.ogg
>
> > > > 10-24 16:47:49.590: ERROR/SoundPool(59): error loading /system/media/
> > > > audio/ui/KeypressDelete.ogg
>
> > > > 10-24 16:47:49.600: ERROR/SoundPool(59): error loading /system/media/
> > > > audio/ui/KeypressReturn.ogg
>
> > > > 10-24 16:47:52.240: ERROR/ThrottleService(59): Could not open GPS
> > > > configuration file /etc/gps.conf
>
> > > > 10-24 16:47:54.020: ERROR/logwrapper(149): executing /system/bin/tc
> > > > failed: No such file or directory
>
> > > > 10-24 16:47:54.080: ERROR/logwrapper(150): executing /system/bin/tc
> > > > failed: No such file or directory
>
> > > > 10-24 16:47:54.150: ERROR/logwrapper(151): executing /system/bin/tc
> > > > failed: No such file or directory
>
> > > > 10-24 16:48:08.823: ERROR/HierarchicalStateMachine(59): TetherMaster -
> > > > unhandledMessage: msg.what=3
>
> > > > 10-24 16:49:47.525: ERROR/AndroidRuntime(313): FATAL EXCEPTION:
> > > > GLThread 11
>
> > > > 10-24 16:49:47.525: ERROR/AndroidRuntime(313):
> > > > java.lang.IllegalArgumentException: No configs match configSpec
>
> > > > 10-24 16:49:47.525: ERROR/AndroidRuntime(313): at
> > > > android.opengl.GLSurfaceView
> > > > $BaseConfigChooser.chooseConfig(GLSurfaceView.java:760)
> > > > 10-24 16:49:47.525: ERROR/AndroidRuntime(313): at
> > > > android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:916)
>
> > > > 10-24 16:49:47.525: ERROR/AndroidRuntime(313): at
> > > > android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:
> > > > 1246)
>
> > > > 10-24 16:49:47.525: ERROR/AndroidRuntime(313): at
> > > > android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
>
> > > > 10-24 16:53:26.284: ERROR/AndroidRuntime(361): FATAL EXCEPTION:
> > > > GLThread 11
>
> > > > 10-24 16:53:26.284: ERROR/AndroidRuntime(361):
> > > > java.lang.IllegalArgumentException: No configs match configSpec
>
> > > > 10-24 16:53:26.284: ERROR/AndroidRuntime(361): at
> > > > android.opengl.GLSurfaceView
> > > > $BaseConfigChooser.chooseConfig(GLSurfaceView.java:760)
>
> > > > 10-24 16:53:26.284: ERROR/AndroidRuntime(361): at
> > > > android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:916)
>
> > > > 10-24 16:53:26.284: ERROR/AndroidRuntime(361): at
> > > > android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:
> > > > 1246)
>
> > > > 10-24 16:53:26.284: ERROR/AndroidRuntime(361): at
> > > > android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1116)
>
> > > > Gente, por favor me ajuda, eu preciso tirar uma foto e gravar um
> > > > vídeo. To desesperado já, Léo
>
> > > --
> > > Thiago Rosahttp://www.thiagorosa.com.brhttps://
> > market.android.com/developer?pub=Thiago+Rosa






0 comentários:
Postar um comentário