Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 829015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T03:48:58+00:00 2026-05-15T03:48:58+00:00

The sample I’m referring to is: CameraPreview . The program simply force closes upon

  • 0

The sample I’m referring to is: CameraPreview.

The program simply force closes upon start up. I’ve also tried other camera demos that have the same problem.

I’m trying to run the samples on my Nexus One and the emulator with the same problem on both. I’m not even sure if the emulator should be able to run them or not.

Based on LogCat, the error is:

06-08 16:39:10.483: ERROR/AndroidRuntime(6726): Uncaught handler: thread main exiting due to uncaught exception
06-08 16:39:10.494: ERROR/AndroidRuntime(6726): java.lang.RuntimeException: Fail to connect to camera service
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.hardware.Camera.native_setup(Native Method)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.hardware.Camera.<init>(Camera.java:110)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.hardware.Camera.open(Camera.java:90)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at com.example.android.apis.graphics.Preview.surfaceCreated(CameraPreview.java:69)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.SurfaceView.updateWindow(SurfaceView.java:454)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.SurfaceView.dispatchDraw(SurfaceView.java:287)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewGroup.drawChild(ViewGroup.java:1529)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.View.draw(View.java:6557)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewGroup.drawChild(ViewGroup.java:1531)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.View.draw(View.java:6557)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.widget.FrameLayout.draw(FrameLayout.java:352)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1830)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewRoot.draw(ViewRoot.java:1349)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewRoot.performTraversals(ViewRoot.java:1114)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.view.ViewRoot.handleMessage(ViewRoot.java:1633)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.os.Handler.dispatchMessage(Handler.java:99)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.os.Looper.loop(Looper.java:123)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at android.app.ActivityThread.main(ActivityThread.java:4363)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at java.lang.reflect.Method.invokeNative(Native Method)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at java.lang.reflect.Method.invoke(Method.java:521)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
06-08 16:39:10.494: ERROR/AndroidRuntime(6726):     at dalvik.system.NativeStart.main(Native Method)

All I did to try out the sample was create a new Android 2.1update1 Project, named everything according to the supplied Java file, copied the Java file from the URL to the CameraPreview.java file, then run it. Am I supposed to do anything else?

Any help would be appreciated. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T03:48:59+00:00Added an answer on May 15, 2026 at 3:48 am

    Add the following to your manifest, as children of the <manifest> element:

    <uses-feature android:name="android.hardware.camera" />
    <uses-permission android:name="android.permission.CAMERA" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.