HEy again.

I'm almost sure the problem is as you mentioned that the camera is
already in use.

I'm going from an activity that uses the camera (wikitude applicaiton)
to an activity that still uses the camera (my own).

I'm not sure what are my options here:
Am I able to continue without releasing the camera or do I have to
release the camera and then start again?

Another issue that I'm having is that I can't seem to find any code on
wikitude demonstration example that starts the camera so I'm not even
sure how to stop it.

Is there any general or standard mode of doing this? I mean.. release
the camera independently from which activity I'm on at the moment?

I would appreciate some insight. Thank you in advance.

Pedro

On Nov 28, 12:40 am, Mark Murphy <mmur...@commonsware.com> wrote:
> One place I have encountered that error is if theCamerais already in
> use (by you or another app on thedevice).
>
> On Sun, Nov 27, 2011 at 7:33 PM, Pedro Teixeira
>
>
>
>
>
> <pedroteixeir...@gmail.com> wrote:
> > Hi,
>
> > I have a location based application that depending on the position of
> > the use relating to a certain spot it turns on thecamera. In layman
> > terms, when there's proximity to a place it triggers thecamera.
>
> > If I'm already near the sport when it's suppose to trigger ( I've
> > build a proximity algorithm based on user position (lat,long) and the
> > spot position) thecameramode opens just fine trough an intent that
> > calls the activity where thecameraaccess is implemented.
>
> > But if I'm walking towards the spot and the trigger is set I get an
> > error. This is the logcat:
>
> > 11-27 20:03:42.451: E/AndroidRuntime(1380): Uncaught handler: thread
> > main exiting due to uncaught exception
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):
> > java.lang.RuntimeException:Failto connect tocameraservice
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.hardware.Camera.native_setup(Native Method)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.hardware.Camera.<init>(Camera.java:85)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.hardware.Camera.open(Camera.java:67)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > com.pedroteixeira.thennnow.thenNnowMode.surfaceCreated(thenNnowMode.java:
> > 229)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.SurfaceView.updateWindow(SurfaceView.java:392)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.SurfaceView.dispatchDraw(SurfaceView.java:264)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewGroup.drawChild(ViewGroup.java:1524)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewGroup.drawChild(ViewGroup.java:1524)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.View.draw(View.java:6277)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.widget.FrameLayout.draw(FrameLayout.java:352)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewGroup.drawChild(ViewGroup.java:1526)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.View.draw(View.java:6277)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.widget.FrameLayout.draw(FrameLayout.java:352)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > com.android.internal.policy.impl.PhoneWindow
> > $DecorView.draw(PhoneWindow.java:1883)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewRoot.draw(ViewRoot.java:1332)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewRoot.performTraversals(ViewRoot.java:1097)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.view.ViewRoot.handleMessage(ViewRoot.java:1613)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.os.Handler.dispatchMessage(Handler.java:99)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.os.Looper.loop(Looper.java:123)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > android.app.ActivityThread.main(ActivityThread.java:4203)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > java.lang.reflect.Method.invoke(Method.java:521)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > com.android.internal.os.ZygoteInit
> > $MethodAndArgsCaller.run(ZygoteInit.java:791)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
> > 11-27 20:03:42.541: E/AndroidRuntime(1380):     at
> > dalvik.system.NativeStart.main(Native Method)
>
> > Does anyone have any idea what can it be? I'm stuck with this issue.
>
> > Thank you so much in advance. All help and tips are highly
> > appreciated.
>
> > Pedro
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Mark Murphy (a Commons 
> Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
>
> Android 3.2 Programming Books:http://commonsware.com/books

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

Reply via email to