logo
down
shadow

What is the best camera parameters for android camera opened in surface view


What is the best camera parameters for android camera opened in surface view

By : Supriya Tirunampalli
Date : November 24 2020, 05:44 AM
I wish this helpful for you It has to do with the different preview sizes there are for the different phones.
The following method I used in a camera preview related android project:
code :


Share : facebook icon twitter icon
Android Camera Surface View

Android Camera Surface View


By : sindhuja
Date : March 29 2020, 07:55 AM
it should still fix some issue I am trying to create a surface view for a camera so it renders on the surface whenever is in the view of the camera. At the moment all I can see on my camera view is a black screen view. I have tried to look on Google and here but so far I haven't found what I am looking for. Anyone can suggest me some idea. , I have written a class that can help you.
code :
    public class Preview_can_work extends Activity {
        private SurfaceView surface_view;  
        private Camera mCamera;
        SurfaceHolder.Callback sh_ob = null;
        SurfaceHolder surface_holder        = null;
        SurfaceHolder.Callback sh_callback  = null;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);

            getWindow().setFormat(PixelFormat.TRANSLUCENT);

            surface_view = new SurfaceView(getApplicationContext());
            addContentView(surface_view, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));

            if (surface_holder == null) {
                surface_holder = surface_view.getHolder();
            }

            sh_callback = my_callback();
            surface_holder.addCallback(sh_callback);
        }

            SurfaceHolder.Callback my_callback() {      
                SurfaceHolder.Callback ob1 = new SurfaceHolder.Callback() {

                    @Override
                    public void surfaceDestroyed(SurfaceHolder holder) {
                          mCamera.stopPreview();
                          mCamera.release();
                          mCamera = null;
                    }

                    @Override
                    public void surfaceCreated(SurfaceHolder holder) {
                        mCamera = Camera.open();

                          try {
                               mCamera.setPreviewDisplay(holder);  
                          } catch (IOException exception) {  
                                mCamera.release();  
                                mCamera = null;  
                          }
                    }

                    @Override
                    public void surfaceChanged(SurfaceHolder holder, int format, int width,
                            int height) {
                        mCamera.startPreview();
                    }
                };
                return ob1;
        }
    }
<uses-permission android:name="android.permission.CAMERA"/>
Camera mCamera = Camera.open();
1. public void surfaceCreated(SurfaceHolder holder)
2. public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
3. public void surfaceDestroyed(SurfaceHolder holder)
Android Camera surface-view camera recreated when i press back button on archos tablet on jellybean

Android Camera surface-view camera recreated when i press back button on archos tablet on jellybean


By : user557610
Date : March 29 2020, 07:55 AM
will be helpful for those in need In my code i have camera preview and video recording on button click so my code works well for recording and preview. , Based on debugging/discussion on chat:
Use Android Camera without surface View

Use Android Camera without surface View


By : Adrian
Date : March 29 2020, 07:55 AM
With these it helps As of API-Level 11 the SurfaceTexture was added. With it a SurfaceView is no longer needed. I tested the following code with my Samsung Galaxy S3 Neo.
UIImagePickerController camera cancel not working after browsed several view and opened camera?

UIImagePickerController camera cancel not working after browsed several view and opened camera?


By : Anil Kumar
Date : March 29 2020, 07:55 AM
This might help you I have some 15 to 20 views in app. One is for camera functionality. I have view in that which is set to UIImagePickerController to display camera. My problem is, when I open camera directly after app launches, everything works fine. I mean cancel, capture feature of default camera functionality. But suppose, if I browse all other than camera like map, webView,etc and atlast if I open camera, the cancel button is not working(capture button is working in all case).After I capture, controls like retake, use are showing successfully but those buttons also not accessible. , Use the following code
Android Camera: Attempt to invoke virtual method Android Camera Parameters on android.hardware.Camera.getParameters()' o

Android Camera: Attempt to invoke virtual method Android Camera Parameters on android.hardware.Camera.getParameters()' o


By : Chong Jia Sheng
Date : March 29 2020, 07:55 AM
With these it helps Check the app in your device Settings, if the required permissions are given or not. In my case, this was the reason for Exception, that I had not given permissions from the Settings.
Hope it helps you.
Related Posts Related Posts :
  • Change Spinner DropDown width
  • Samsung Galaxy S4 Screen Size
  • Android text style missing light, medium, thin,
  • Android Studio gradle build failed for hello world app
  • Slide a layout up from bottom of screen
  • Play HTML5 video in iOS/Android native media player
  • How to rescale a bitmap file in android?
  • No view found for id 0x for fragment after rotation?
  • Define different themable styles to the same widget types
  • ProGuard not working in my app
  • FragmentTransaction from BaseAdapter
  • Connecting multiple devices in a Wifi Direct group
  • Why TabActivity is deprecated in android
  • How to capture low resolution picture using android camera
  • android preferenceactivity padding in landscape orientation
  • How can I store cookie in webview?
  • Passing variables from one activity to another
  • Create Multicolored Pie Chart in Android Studio
  • how to kill progress dialog in android
  • Show Error on the tip of the Edit Text Android
  • How do I use getWindowManager() by another java file
  • fetching images from gallery on android phones with internal storage
  • How to discover devices like Google TV and Nexus-Q using MediaRoute API on Android?
  • "Unfortunately your app stopped working"- Facebook Integration for Android
  • How to animate button in android?
  • Resource Not Found Exception in class without context or activity
  • Launching Android Netflix App And Passing Video Id
  • Making a Phone Call with a Number Extension
  • NullPointerException at BoringLayout.isBoring is anything but boring
  • java.lang.RuntimeException: Unable to get provider
  • Testing custom Views with Robolectric
  • tools:listheader doesn't work although tools:listitem does
  • oppo, vivo app kill notification not coming in android fcm
  • OnClick Method could not function correctly with if else statement
  • Best method to download image from url in Android
  • How can I open Drawer Layout moving all the view and not just slide over?
  • how to show profile pictures of friends in a list view?
  • Creating TimePickerDialog with custom style in Android
  • Android 2.3.6 support library v7 option menu is missing
  • need of vblank in Display subssytem
  • Android MP4 stream - Video cannot be played
  • FastAdapter: Undo button does not show up after swipe
  • What are reasons to pass getActivity as the LifecycleOwner to the LiveData's observe method in a fragment?
  • Implement Face Recognition in Android
  • Titanium studio cannot run "titanium" command in terminal
  • How to execute command line ffmpeg commands programatically in android?
  • Make Android List Items clickable with each item pointing to a different link
  • listview runs successfully, but nothing is display in emulator
  • How to zoom in a bitmap with high resolution?
  • Passing listView data through intent
  • Google map route direction show by arrows in android v2
  • how to start "uiautomator test run" from android code?
  • Proguard in Android Library
  • Alarm Clock from GIT - Gives error - Android
  • Mock injection using Mockito - Android
  • Get Bitmap from universal image loader
  • Unable to include custom font in android
  • Basics on using logcat in Android development
  • Android: Clear cache programmatically
  • Android: pass object without serialization
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org