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 8833801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:52:08+00:00 2026-06-14T08:52:08+00:00

I have a small app I have been working on that uses the front

  • 0

I have a small app I have been working on that uses the front camera. The way I have been obtaining use of the front camera seems to work on most phones, but users have been reporting trouble on the S3 and various other new devices. The way I have been accessing the front camera is like so:

// Find the ID of the front camera
        CameraInfo cameraInfo = new CameraInfo();
        for(int i = 0; i < numberOfCameras; i++) {
            Camera.getCameraInfo(i, cameraInfo);
            if(cameraInfo.facing == CameraInfo.CAMERA_FACING_FRONT) {
                defaultCameraId = i;
                mCameraFound = true;
            }
        }
        if(!mCameraFound) 
            displayDialog(8);

From some of the error reporting I’ve added into the app, I’ve noticed the S3 actually finds the front camera, but users report it only shows a blank screen? I have only been able to test on the devices I have (GNex and N7). I was hoping someone here may have some experience with this or may be able to help me solve this issue. If you want to try the app out on your S3, check the link below. Thanks in advance.

https://play.google.com/store/apps/details?id=com.wckd_dev.mirror

EDIT: I created a MirrorView object which contains a TextureView used for the preview. The MirrorView object implements a SurfaceTextureListener. Within the onSurfaceTextureAvailable() method is where the preview is started. I also created a method for restarting the preview after the app has gone from hidden back to visible.

So this is called when the app is first started:

    @Override
    public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
        try {
            if (mCamera != null) {

                Camera.Parameters parameters = mCamera.getParameters();
                parameters.setPreviewSize(mPreviewSize.height, mPreviewSize.width);
                requestLayout();

                mCamera.setParameters(parameters);
                mCamera.setPreviewTexture(surface);
                mCamera.startPreview();
            }
        } 
        catch(RuntimeException e) {
            // Log.e(TAG, "RuntimeException caused by setPreviewTexture()", exception);
        }
        catch (IOException e) {
            // Log.e(TAG, "IOException caused by setPreviewTexture()", exception);
        }
    }

The restartPreview call is to an identical (but separate) method. From some of the debug data I’ve been collecting through users, I’ve noticed that the app finds two camera on the S III and selects the id matching CAMERA_FACING_FRONT. Also, this issue doesn’t seem to be happening on all S III. I have users who have feedback reporting as much. The latest report from a user experiencing this issue was an AT&T S III user. Any help would be appreciated!

  • 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-06-14T08:52:09+00:00Added an answer on June 14, 2026 at 8:52 am

    Got some face time with an S3 tonight that was experiencing this issue with my app. Here what was going on. The TextureView relies on 2d hardware acceleration which is supposed to on by default (from what I understood) on 4.0+ devices. It wasn’t turning on (for my app at least) on his phone. The fix was as simple as adding a single line in the manifest (under application).

    android:hardwareAcceleration = "true"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been working on a small php app (400K total). But in the
I have a small app I'm working on where I'm trying to use Django's
I have been working on a small web app using the Stripes framework. Now
I have a small open source OSX project I've been working on that I'd
I am new to ios app development I have been working on a small
So I have been developing a small ASP.NET web app in C# for my
I have small web app that generate PDF files as a report. I'm trying
I have a small app that downloads some files from a remote (HTTP) server
I have a relatively small app that Im building using vb.net 2.0, and nant.
I have a small .NET app that I'm running under Windows 2008 Server via

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.