android camera issue

76 views
Skip to first unread message

ConchitaBH

unread,
Oct 27, 2011, 4:55:25 PM10/27/11
to phonegap
Hi, i'm new on mobile development, I started to work with phonegap for
android, and I have an issue with the camera, I already saw the other
issues about it, but i still have the same problem:
when i use getpicture (from camera), i took the picture and save it
but when the app have to continue and show the picture on it, it
return me to the main menu of the app, not to the section where i was
before taking the picture.
It only happens on android 2.2 device, i tried it on 2.1 device
without problems. I tried with both options (64 bits and Uri file)
with the same result.
This is the code for base 64 (but also tried Uri file option too)

navigator.camera.getPicture(function onSuccess(imageData) {
var image = document.getElementById('qimageencode'+questionID);
image.src = "data:image/jpeg;base64," + imageData;
}, function onFail(message) {
alert('Failed because: ' + message);
}, { quality: 50 });

Thanks in advance

conchitabh

Simon MacDonald

unread,
Oct 31, 2011, 3:36:57 PM10/31/11
to phon...@googlegroups.com
Check in your AndroidManifest.xml to make sure you have 

android:configChanges="orientation|keyboardHidden"

in your activity. It sounds like the orientation change is causing your page to reload.

Simon Mac Donald
http://hi.im/simonmacdonald



--
You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en

For more info on PhoneGap or to download the code go to www.phonegap.com

Richard Kimber

unread,
Nov 15, 2011, 12:07:06 PM11/15/11
to phonegap
Hi Simon,

I'm having this problem with a Huawei device running Gingerbread. The
app uses Phonegap 1.2.0 and Sencha Touch 1.1 (I think). On exiting the
Camera, Gallery or File apps the app reloads. It doesn't matter
whether you select/take a photo or not.

My manifest already includes android:configChanges="orientation|
keyboardHidden" .

Based on your comments re orientation I've also taken steps to lock
orientation of my app using:

this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);

In the onCreate method.

Rich

On Oct 31, 7:36 pm, Simon MacDonald <simon.macdon...@gmail.com> wrote:
> Check in your AndroidManifest.xml to make sure you have
>
> android:configChanges="orientation|keyboardHidden"
>
> in your activity. It sounds like the orientation change is causing your
> page to reload.
>
> Simon Mac Donaldhttp://hi.im/simonmacdonald

Simon MacDonald

unread,
Nov 15, 2011, 2:01:16 PM11/15/11
to phon...@googlegroups.com
Richard,

Can you run "adb logcat" while reproducing the problem? I'm trying to
collect as many logs as possible since I don't have a device that
reproduces the bug.

Thanks...

Michael Butcher

unread,
Nov 15, 2011, 2:55:08 PM11/15/11
to phonegap
Hi Richard,
I have been experiencing the same issue on HTC EVO Shift and Droid X.
I believe you are running out of memory and the app is crashing.

I found this fix:

https://issues.apache.org/jira/browse/CB-14?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel#issue-tabs

But I am not sure how/where to implement it for an Android PhoneGap
Project.
Anyone have instructions?

Thanks
Mike

Simon MacDonald

unread,
Nov 16, 2011, 2:02:24 PM11/16/11
to phon...@googlegroups.com
Actually, can you send me a reproduction scenario. That is, actual
code? I can't fix this until I can reproduce it.

Michael Butcher

unread,
Nov 30, 2011, 11:19:34 AM11/30/11
to phonegap
After struggling with Camera Crashing issues for Months I have found a
solution.
Try installing a different Camera App on your Phone.
I was experiencing the same Camera Crash issues on My HTC EVO Shift
and Droid X until I installed an app called GoSMS. GoSMS is free and
has a simple camera app that doesn't crash my phonegap app after
taking a photo.
I hope this tip saves someone else's some valuable time.
Mike Butcher

On Oct 27, 3:55 pm, ConchitaBH <isc.conchit...@gmail.com> wrote:
> Hi, i'm new on mobile development, I started to work with phonegap for
> android, and I have an issue with thecamera, I already saw the other

> issues about it, but i still have the same problem:
> when i use getpicture (fromcamera), i took the picture and save it
Reply all
Reply to author
Forward
0 new messages